<?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 Version20220302110402 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 lap_time ADD country_group_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE lap_time ADD CONSTRAINT FK_30163F4ECD9E88FA FOREIGN KEY (country_group_id) REFERENCES country_group (id)');
$this->addSql('CREATE INDEX IDX_30163F4ECD9E88FA ON lap_time (country_group_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE car CHANGE name name VARCHAR(255) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE identifier identifier VARCHAR(255) NOT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE country CHANGE name name VARCHAR(255) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE identifier identifier VARCHAR(255) NOT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE country_group CHANGE name name VARCHAR(255) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE identifier identifier VARCHAR(5) NOT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE game_server CHANGE path path LONGTEXT NOT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE lap_time DROP FOREIGN KEY FK_30163F4ECD9E88FA');
$this->addSql('DROP INDEX IDX_30163F4ECD9E88FA ON lap_time');
$this->addSql('ALTER TABLE lap_time DROP country_group_id, CHANGE laptime laptime VARCHAR(255) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE sector1 sector1 VARCHAR(255) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE sector2 sector2 VARCHAR(255) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE sector3 sector3 VARCHAR(255) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE stracker_identifier stracker_identifier VARCHAR(255) NOT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE messenger_messages CHANGE body body LONGTEXT NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE headers headers LONGTEXT NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE queue_name queue_name VARCHAR(255) NOT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE registered CHANGE lastname lastname VARCHAR(255) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE firstname firstname VARCHAR(255) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE email email VARCHAR(255) NOT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE server CHANGE hostname hostname VARCHAR(255) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE login login VARCHAR(255) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE password password VARCHAR(255) NOT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE user CHANGE email email VARCHAR(180) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE roles roles LONGTEXT NOT NULL COLLATE `utf8mb4_unicode_ci` COMMENT \'(DC2Type:json)\', CHANGE steam_id steam_id VARCHAR(255) DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE discord_id discord_id VARCHAR(255) DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE discord_username discord_username VARCHAR(255) DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE avatar avatar VARCHAR(255) DEFAULT NULL COLLATE `utf8mb4_unicode_ci`');
}
}