<?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 Version20220314194048 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->abortIf(
!$this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQL80Platform,
"Migration can only be executed safely on '\Doctrine\DBAL\Platforms\MySQL80Platform'."
);
$this->addSql('CREATE TABLE category (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) CHARACTER SET utf8 NOT NULL COLLATE `utf8_unicode_ci`, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->abortIf(
!$this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQL80Platform,
"Migration can only be executed safely on '\Doctrine\DBAL\Platforms\MySQL80Platform'."
);
$this->addSql('CREATE TABLE layer (id INT AUTO_INCREMENT NOT NULL, category_id INT NOT NULL, name VARCHAR(255) CHARACTER SET utf8 NOT NULL COLLATE `utf8_unicode_ci`, image VARCHAR(1024) CHARACTER SET utf8 DEFAULT \'NULL\' COLLATE `utf8_unicode_ci`, INDEX IDX_E4DB211A12469DE2 (category_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->abortIf(
!$this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQL80Platform,
"Migration can only be executed safely on '\Doctrine\DBAL\Platforms\MySQL80Platform'."
);
$this->addSql('CREATE TABLE layer_race (layer_id INT NOT NULL, race_id INT NOT NULL, INDEX IDX_E5A60F5EA6EFDCD (layer_id), INDEX IDX_E5A60F56E59D40D (race_id), PRIMARY KEY(layer_id, race_id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->abortIf(
!$this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQL80Platform,
"Migration can only be executed safely on '\Doctrine\DBAL\Platforms\MySQL80Platform'."
);
$this->addSql('CREATE TABLE race (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) CHARACTER SET utf8 NOT NULL COLLATE `utf8_unicode_ci`, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->abortIf(
!$this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQL80Platform,
"Migration can only be executed safely on '\Doctrine\DBAL\Platforms\MySQL80Platform'."
);
$this->addSql('CREATE TABLE user (id INT AUTO_INCREMENT NOT NULL, email VARCHAR(180) CHARACTER SET utf8 NOT NULL COLLATE `utf8_unicode_ci`, roles LONGTEXT CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_bin`, password VARCHAR(255) CHARACTER SET utf8 NOT NULL COLLATE `utf8_unicode_ci`, UNIQUE INDEX UNIQ_8D93D649E7927C74 (email), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
!$this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQL80Platform,
"Migration can only be executed safely on '\Doctrine\DBAL\Platforms\MySQL80Platform'."
);
$this->addSql('DROP TABLE category');
$this->abortIf(
!$this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQL80Platform,
"Migration can only be executed safely on '\Doctrine\DBAL\Platforms\MySQL80Platform'."
);
$this->addSql('DROP TABLE layer');
$this->abortIf(
!$this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQL80Platform,
"Migration can only be executed safely on '\Doctrine\DBAL\Platforms\MySQL80Platform'."
);
$this->addSql('DROP TABLE layer_race');
$this->abortIf(
!$this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQL80Platform,
"Migration can only be executed safely on '\Doctrine\DBAL\Platforms\MySQL80Platform'."
);
$this->addSql('DROP TABLE race');
$this->abortIf(
!$this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQL80Platform,
"Migration can only be executed safely on '\Doctrine\DBAL\Platforms\MySQL80Platform'."
);
$this->addSql('DROP TABLE user');
}
}