<?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 Version20220615132706 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 corps (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE rank (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE respondent (id INT AUTO_INCREMENT NOT NULL, corps_id INT NOT NULL, rank_id INT NOT NULL, start DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', end_time DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\', already_trained TINYINT(1) NOT NULL, INDEX IDX_409B5150190A1B68 (corps_id), INDEX IDX_409B51507616678F (rank_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE respondent ADD CONSTRAINT FK_409B5150190A1B68 FOREIGN KEY (corps_id) REFERENCES corps (id)');
$this->addSql('ALTER TABLE respondent ADD CONSTRAINT FK_409B51507616678F FOREIGN KEY (rank_id) REFERENCES rank (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE respondent DROP FOREIGN KEY FK_409B5150190A1B68');
$this->addSql('ALTER TABLE respondent DROP FOREIGN KEY FK_409B51507616678F');
$this->addSql('DROP TABLE corps');
$this->addSql('DROP TABLE rank');
$this->addSql('DROP TABLE respondent');
}
}