<?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 Version20230210115143 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 rank DROP FOREIGN KEY FK_8879E8E5190A1B68');
$this->addSql('ALTER TABLE rank_category DROP FOREIGN KEY FK_830BA59C190A1B68');
$this->addSql('DROP TABLE corps');
$this->addSql('DROP TABLE zone');
$this->addSql('DROP INDEX IDX_8879E8E5190A1B68 ON rank');
$this->addSql('ALTER TABLE rank DROP corps_id');
$this->addSql('DROP INDEX IDX_830BA59C190A1B68 ON rank_category');
$this->addSql('ALTER TABLE rank_category DROP corps_id');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE corps (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('CREATE TABLE zone (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('ALTER TABLE rank ADD corps_id INT NOT NULL');
$this->addSql('ALTER TABLE rank ADD CONSTRAINT FK_8879E8E5190A1B68 FOREIGN KEY (corps_id) REFERENCES corps (id)');
$this->addSql('CREATE INDEX IDX_8879E8E5190A1B68 ON rank (corps_id)');
$this->addSql('ALTER TABLE rank_category ADD corps_id INT NOT NULL');
$this->addSql('ALTER TABLE rank_category ADD CONSTRAINT FK_830BA59C190A1B68 FOREIGN KEY (corps_id) REFERENCES corps (id)');
$this->addSql('CREATE INDEX IDX_830BA59C190A1B68 ON rank_category (corps_id)');
}
}