<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250613094758 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE food_journal_coffee (id INT AUTO_INCREMENT NOT NULL, owner_id INT NOT NULL, entry_id INT NOT NULL, hour DATETIME NOT NULL, INDEX IDX_E68CF49D7E3C61F9 (owner_id), INDEX IDX_E68CF49DBA364942 (entry_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE food_journal_coffee ADD CONSTRAINT FK_E68CF49D7E3C61F9 FOREIGN KEY (owner_id) REFERENCES access (id)');
$this->addSql('ALTER TABLE food_journal_coffee ADD CONSTRAINT FK_E68CF49DBA364942 FOREIGN KEY (entry_id) REFERENCES food_journal_entry (id)');
$this->addSql('ALTER TABLE food_journal_meal_type DROP FOREIGN KEY FK_E999EC747E3C61F9');
$this->addSql('DROP INDEX IDX_E999EC747E3C61F9 ON food_journal_meal_type');
$this->addSql('ALTER TABLE food_journal_meal_type DROP owner_id');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE food_journal_coffee');
$this->addSql('ALTER TABLE food_journal_meal_type ADD owner_id INT NOT NULL');
$this->addSql('ALTER TABLE food_journal_meal_type ADD CONSTRAINT FK_E999EC747E3C61F9 FOREIGN KEY (owner_id) REFERENCES access (id)');
$this->addSql('CREATE INDEX IDX_E999EC747E3C61F9 ON food_journal_meal_type (owner_id)');
}
}