<?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 Version20240725174326 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 city (id INT AUTO_INCREMENT NOT NULL, tgi_id INT DEFAULT NULL, name VARCHAR(255) NOT NULL, zip_code VARCHAR(10) NOT NULL, code VARCHAR(10) NOT NULL, deleted TINYINT(1) NOT NULL, INDEX IDX_2D5B0234D54DE182 (tgi_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE tgi (id INT AUTO_INCREMENT NOT NULL, gouv_id VARCHAR(40) NOT NULL, name VARCHAR(255) NOT NULL, address1 VARCHAR(255) NOT NULL, address2 VARCHAR(255) DEFAULT NULL, zip_code VARCHAR(10) NOT NULL, city VARCHAR(255) NOT NULL, deleted TINYINT(1) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE city ADD CONSTRAINT FK_2D5B0234D54DE182 FOREIGN KEY (tgi_id) REFERENCES tgi (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE city DROP FOREIGN KEY FK_2D5B0234D54DE182');
$this->addSql('DROP TABLE city');
$this->addSql('DROP TABLE tgi');
}
}