<?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 Version20241217073638 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('ALTER TABLE game_quiz_school_class DROP FOREIGN KEY FK_F17767F614463F54');
$this->addSql('ALTER TABLE game_quiz_school_class DROP FOREIGN KEY FK_F17767F6780B43E2');
$this->addSql('ALTER TABLE game_quiz_school_class DROP FOREIGN KEY FK_F17767F6D27F8922');
$this->addSql('ALTER TABLE game_jeopardy_school_class DROP FOREIGN KEY FK_52258E0B14463F54');
$this->addSql('ALTER TABLE game_jeopardy_question_school_class_mapping DROP FOREIGN KEY FK_5F8D948584104B01');
$this->addSql('ALTER TABLE game_jeopardy_question_school_class_mapping DROP FOREIGN KEY FK_5F8D9485E1F9AB61');
$this->addSql('ALTER TABLE game_quiz_question_school_class_mapping DROP FOREIGN KEY FK_3FA5BBE3F102203');
$this->addSql('ALTER TABLE game_quiz_question_school_class_mapping DROP FOREIGN KEY FK_3FA5BBE333D5D35C');
$this->addSql('DROP TABLE game_quiz_question_category');
$this->addSql('DROP TABLE game_quiz_school_class');
$this->addSql('DROP TABLE game_jeopardy_question');
$this->addSql('DROP TABLE game_jeopardy_school_class');
$this->addSql('DROP TABLE game_jeopardy_question_school_class_mapping');
$this->addSql('DROP TABLE game_quiz_question_school_class_mapping');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE game_quiz_question_category (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(191) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, category_letter VARCHAR(191) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, is_active TINYINT(1) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('CREATE TABLE game_quiz_school_class (id INT AUTO_INCREMENT NOT NULL, school_class_id INT DEFAULT NULL, game_quiz_question_category_id INT DEFAULT NULL, job_daily_routine_id INT DEFAULT NULL, start_date DATETIME NOT NULL, joker_a INT DEFAULT 0 NOT NULL, joker_b INT DEFAULT 0 NOT NULL, joker_c INT DEFAULT 0 NOT NULL, INDEX IDX_F17767F6D27F8922 (job_daily_routine_id), INDEX IDX_F17767F614463F54 (school_class_id), INDEX IDX_F17767F6780B43E2 (game_quiz_question_category_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('CREATE TABLE game_jeopardy_question (id INT AUTO_INCREMENT NOT NULL, csv_id INT NOT NULL, question MEDIUMTEXT CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, answer_a MEDIUMTEXT CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, answer_b MEDIUMTEXT CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, answer_c MEDIUMTEXT CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, answer_d MEDIUMTEXT CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, chapter_id INT NOT NULL, is_active TINYINT(1) DEFAULT 1, created_at DATETIME NOT NULL, UNIQUE INDEX UNIQ_ACA31E105684A52A (csv_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('CREATE TABLE game_jeopardy_school_class (id INT AUTO_INCREMENT NOT NULL, school_class_id INT DEFAULT NULL, start_date DATETIME NOT NULL, chapter_1_questions INT DEFAULT 0 NOT NULL, chapter_2_questions INT DEFAULT 0 NOT NULL, chapter_3_questions INT DEFAULT 0 NOT NULL, chapter_4_questions INT DEFAULT 0 NOT NULL, chapter_5_questions INT DEFAULT 0 NOT NULL, INDEX IDX_52258E0B14463F54 (school_class_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('CREATE TABLE game_jeopardy_question_school_class_mapping (id INT AUTO_INCREMENT NOT NULL, game_jeopardy_school_class_id INT DEFAULT NULL, game_jeopardy_question_id INT DEFAULT NULL, play_date DATETIME NOT NULL, answer TINYINT(1) NOT NULL, has_sent_answer TINYINT(1) DEFAULT NULL, INDEX IDX_5F8D948584104B01 (game_jeopardy_school_class_id), INDEX IDX_5F8D9485E1F9AB61 (game_jeopardy_question_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('CREATE TABLE game_quiz_question_school_class_mapping (id INT AUTO_INCREMENT NOT NULL, game_quiz_school_class_id INT DEFAULT NULL, game_quiz_question_id INT DEFAULT NULL, play_date DATETIME NOT NULL, answer TINYINT(1) NOT NULL, has_sent_answer TINYINT(1) DEFAULT NULL, INDEX IDX_3FA5BBE333D5D35C (game_quiz_school_class_id), INDEX IDX_3FA5BBE3F102203 (game_quiz_question_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('ALTER TABLE game_quiz_school_class ADD CONSTRAINT FK_F17767F614463F54 FOREIGN KEY (school_class_id) REFERENCES school_class (id)');
$this->addSql('ALTER TABLE game_quiz_school_class ADD CONSTRAINT FK_F17767F6780B43E2 FOREIGN KEY (game_quiz_question_category_id) REFERENCES game_quiz_question_category (id)');
$this->addSql('ALTER TABLE game_quiz_school_class ADD CONSTRAINT FK_F17767F6D27F8922 FOREIGN KEY (job_daily_routine_id) REFERENCES job_daily_routine (id)');
$this->addSql('ALTER TABLE game_jeopardy_school_class ADD CONSTRAINT FK_52258E0B14463F54 FOREIGN KEY (school_class_id) REFERENCES school_class (id)');
$this->addSql('ALTER TABLE game_jeopardy_question_school_class_mapping ADD CONSTRAINT FK_5F8D948584104B01 FOREIGN KEY (game_jeopardy_school_class_id) REFERENCES game_jeopardy_school_class (id)');
$this->addSql('ALTER TABLE game_jeopardy_question_school_class_mapping ADD CONSTRAINT FK_5F8D9485E1F9AB61 FOREIGN KEY (game_jeopardy_question_id) REFERENCES game_jeopardy_question (id)');
$this->addSql('ALTER TABLE game_quiz_question_school_class_mapping ADD CONSTRAINT FK_3FA5BBE3F102203 FOREIGN KEY (game_quiz_question_id) REFERENCES game_quiz_question (id)');
$this->addSql('ALTER TABLE game_quiz_question_school_class_mapping ADD CONSTRAINT FK_3FA5BBE333D5D35C FOREIGN KEY (game_quiz_school_class_id) REFERENCES game_quiz_school_class (id)');
}
}