<?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 Version20240523121837 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 (id INT AUTO_INCREMENT NOT NULL, school_class_client_id INT DEFAULT NULL, game_type_id INT DEFAULT NULL, created_at DATETIME NOT NULL, INDEX IDX_232B318CEC912EB2 (school_class_client_id), INDEX IDX_232B318C508EF3BC (game_type_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE game_type (id INT AUTO_INCREMENT NOT NULL, game_name VARCHAR(191) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE game ADD CONSTRAINT FK_232B318CEC912EB2 FOREIGN KEY (school_class_client_id) REFERENCES school_class_client (id)');
$this->addSql('ALTER TABLE game ADD CONSTRAINT FK_232B318C508EF3BC FOREIGN KEY (game_type_id) REFERENCES game_type (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE game DROP FOREIGN KEY FK_232B318CEC912EB2');
$this->addSql('ALTER TABLE game DROP FOREIGN KEY FK_232B318C508EF3BC');
$this->addSql('DROP TABLE game');
$this->addSql('DROP TABLE game_type');
}
}