<?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 Version20220111144324 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 continent (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(20) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE country (id INT AUTO_INCREMENT NOT NULL, continent_id INT DEFAULT NULL, name VARCHAR(100) NOT NULL, cca2 VARCHAR(3) DEFAULT NULL, cca3 VARCHAR(3) DEFAULT NULL, ccn3 INT DEFAULT NULL, sub_continent INT DEFAULT NULL, INDEX IDX_5373C966921F4C77 (continent_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE referee (id INT AUTO_INCREMENT NOT NULL, country_id INT DEFAULT NULL, email VARCHAR(180) NOT NULL, roles JSON NOT NULL, password VARCHAR(255) NOT NULL, firstname VARCHAR(255) NOT NULL, lastname VARCHAR(255) NOT NULL, avatar VARCHAR(255) DEFAULT NULL, birthday DATE DEFAULT NULL, gender TINYINT(1) NOT NULL, phone1 VARCHAR(255) NOT NULL, phone2 VARCHAR(255) DEFAULT NULL, kyorugi_number VARCHAR(255) DEFAULT NULL, poomsae_number VARCHAR(255) DEFAULT NULL, kyorugi_class VARCHAR(255) DEFAULT NULL, poomsae_class VARCHAR(255) DEFAULT NULL, badge VARCHAR(255) DEFAULT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', UNIQUE INDEX UNIQ_D60FB342E7927C74 (email), INDEX IDX_D60FB342F92F3E70 (country_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE country ADD CONSTRAINT FK_5373C966921F4C77 FOREIGN KEY (continent_id) REFERENCES continent (id)');
$this->addSql('ALTER TABLE referee ADD CONSTRAINT FK_D60FB342F92F3E70 FOREIGN KEY (country_id) REFERENCES country (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE country DROP FOREIGN KEY FK_5373C966921F4C77');
$this->addSql('ALTER TABLE referee DROP FOREIGN KEY FK_D60FB342F92F3E70');
$this->addSql('DROP TABLE continent');
$this->addSql('DROP TABLE country');
$this->addSql('DROP TABLE referee');
}
}