migrations/Version20260209074501.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. /**
  7.  * Auto-generated Migration: Please modify to your needs!
  8.  */
  9. final class Version20260209074501 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return '';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         // this up() migration is auto-generated, please modify it to your needs
  18.         $this->addSql('CREATE TABLE game_trophy_hunt_school_class (id INT AUTO_INCREMENT NOT NULL, interest_field_id INT DEFAULT NULL, school_class_id INT DEFAULT NULL, start_at DATETIME DEFAULT NULL, end_at DATETIME DEFAULT NULL, created_at DATETIME NOT NULL, INDEX IDX_B807E01438E49270 (interest_field_id), INDEX IDX_B807E01414463F54 (school_class_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  19.         $this->addSql('CREATE TABLE game_trophy_hunt_school_class_entry (id INT AUTO_INCREMENT NOT NULL, game_trophy_hunt_school_class_id INT DEFAULT NULL, game_trophy_hunt_step_id INT DEFAULT NULL, start_at DATETIME DEFAULT NULL, end_at DATETIME DEFAULT NULL, created_at DATETIME NOT NULL, INDEX IDX_471061AFBD74A86B (game_trophy_hunt_school_class_id), INDEX IDX_471061AF50C23313 (game_trophy_hunt_step_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  20.         $this->addSql('CREATE TABLE game_trophy_hunt_step (id INT AUTO_INCREMENT NOT NULL, interest_field_id INT DEFAULT NULL, searched_string VARCHAR(512) NOT NULL, position INT NOT NULL, created_at DATETIME NOT NULL, INDEX IDX_643B49E938E49270 (interest_field_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  21.         $this->addSql('ALTER TABLE game_trophy_hunt_school_class ADD CONSTRAINT FK_B807E01438E49270 FOREIGN KEY (interest_field_id) REFERENCES interest_field (id)');
  22.         $this->addSql('ALTER TABLE game_trophy_hunt_school_class ADD CONSTRAINT FK_B807E01414463F54 FOREIGN KEY (school_class_id) REFERENCES school_class (id)');
  23.         $this->addSql('ALTER TABLE game_trophy_hunt_school_class_entry ADD CONSTRAINT FK_471061AFBD74A86B FOREIGN KEY (game_trophy_hunt_school_class_id) REFERENCES game_trophy_hunt_school_class (id)');
  24.         $this->addSql('ALTER TABLE game_trophy_hunt_school_class_entry ADD CONSTRAINT FK_471061AF50C23313 FOREIGN KEY (game_trophy_hunt_step_id) REFERENCES game_trophy_hunt_step (id)');
  25.         $this->addSql('ALTER TABLE game_trophy_hunt_step ADD CONSTRAINT FK_643B49E938E49270 FOREIGN KEY (interest_field_id) REFERENCES interest_field (id)');
  26.     }
  27.     public function down(Schema $schema): void
  28.     {
  29.         // this down() migration is auto-generated, please modify it to your needs
  30.         $this->addSql('ALTER TABLE game_trophy_hunt_school_class DROP FOREIGN KEY FK_B807E01438E49270');
  31.         $this->addSql('ALTER TABLE game_trophy_hunt_school_class DROP FOREIGN KEY FK_B807E01414463F54');
  32.         $this->addSql('ALTER TABLE game_trophy_hunt_school_class_entry DROP FOREIGN KEY FK_471061AFBD74A86B');
  33.         $this->addSql('ALTER TABLE game_trophy_hunt_school_class_entry DROP FOREIGN KEY FK_471061AF50C23313');
  34.         $this->addSql('ALTER TABLE game_trophy_hunt_step DROP FOREIGN KEY FK_643B49E938E49270');
  35.         $this->addSql('DROP TABLE game_trophy_hunt_school_class');
  36.         $this->addSql('DROP TABLE game_trophy_hunt_school_class_entry');
  37.         $this->addSql('DROP TABLE game_trophy_hunt_step');
  38.     }
  39. }