<?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 Version20260209074501 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 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');
$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');
$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');
$this->addSql('ALTER TABLE game_trophy_hunt_school_class ADD CONSTRAINT FK_B807E01438E49270 FOREIGN KEY (interest_field_id) REFERENCES interest_field (id)');
$this->addSql('ALTER TABLE game_trophy_hunt_school_class ADD CONSTRAINT FK_B807E01414463F54 FOREIGN KEY (school_class_id) REFERENCES school_class (id)');
$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)');
$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)');
$this->addSql('ALTER TABLE game_trophy_hunt_step ADD CONSTRAINT FK_643B49E938E49270 FOREIGN KEY (interest_field_id) REFERENCES interest_field (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE game_trophy_hunt_school_class DROP FOREIGN KEY FK_B807E01438E49270');
$this->addSql('ALTER TABLE game_trophy_hunt_school_class DROP FOREIGN KEY FK_B807E01414463F54');
$this->addSql('ALTER TABLE game_trophy_hunt_school_class_entry DROP FOREIGN KEY FK_471061AFBD74A86B');
$this->addSql('ALTER TABLE game_trophy_hunt_school_class_entry DROP FOREIGN KEY FK_471061AF50C23313');
$this->addSql('ALTER TABLE game_trophy_hunt_step DROP FOREIGN KEY FK_643B49E938E49270');
$this->addSql('DROP TABLE game_trophy_hunt_school_class');
$this->addSql('DROP TABLE game_trophy_hunt_school_class_entry');
$this->addSql('DROP TABLE game_trophy_hunt_step');
}
}