29 lines
766 B
PHP
29 lines
766 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace DoctrineMigrations;
|
|
|
|
use Doctrine\DBAL\Schema\Schema;
|
|
use Doctrine\Migrations\AbstractMigration;
|
|
|
|
final class Version20260409000000 extends AbstractMigration
|
|
{
|
|
public function getDescription(): string
|
|
{
|
|
return 'Ajoute osm_id sur coastal_point pour idempotence import OSM';
|
|
}
|
|
|
|
public function up(Schema $schema): void
|
|
{
|
|
$this->addSql('ALTER TABLE coastal_point ADD osm_id VARCHAR(30) DEFAULT NULL');
|
|
$this->addSql('CREATE UNIQUE INDEX uniq_coastal_osm_id ON coastal_point (osm_id)');
|
|
}
|
|
|
|
public function down(Schema $schema): void
|
|
{
|
|
$this->addSql('DROP INDEX uniq_coastal_osm_id');
|
|
$this->addSql('ALTER TABLE coastal_point DROP COLUMN osm_id');
|
|
}
|
|
}
|