<?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 Version20220425122602 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 ville ADD departement_id INT DEFAULT NULL, CHANGE code_departement code_departement VARCHAR(3) DEFAULT NULL, CHANGE cp cp VARCHAR(255) DEFAULT NULL, CHANGE slug slug VARCHAR(255) DEFAULT NULL, CHANGE gps_lat gps_lat NUMERIC(16, 14) DEFAULT NULL, CHANGE gps_lng gps_lng NUMERIC(17, 14) DEFAULT NULL');
$this->addSql('ALTER TABLE ville ADD CONSTRAINT FK_43C3D9C3CCF9E01E FOREIGN KEY (departement_id) REFERENCES departement (id)');
$this->addSql('CREATE INDEX IDX_43C3D9C3CCF9E01E ON ville (departement_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE ville DROP FOREIGN KEY FK_43C3D9C3CCF9E01E');
$this->addSql('DROP INDEX IDX_43C3D9C3CCF9E01E ON ville');
$this->addSql('ALTER TABLE ville DROP departement_id, CHANGE code_departement code_departement VARCHAR(3) NOT NULL, CHANGE cp cp VARCHAR(5) DEFAULT NULL, CHANGE slug slug VARCHAR(255) NOT NULL, CHANGE gps_lat gps_lat DOUBLE PRECISION NOT NULL, CHANGE gps_lng gps_lng DOUBLE PRECISION NOT NULL');
}
}