Feature: Create a base importer for geographical units and add index

This commit is contained in:
2022-10-03 15:45:42 +02:00
parent 994160f28a
commit 9c3ac72426
5 changed files with 359 additions and 3 deletions

View File

@@ -0,0 +1,30 @@
<?php
declare(strict_types=1);
namespace Chill\Migrations\Main;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20221003132620 extends AbstractMigration
{
public function getDescription(): string
{
return 'Create indexes and unique constraints on geographical unit entities';
}
public function up(Schema $schema): void
{
$this->addSql('CREATE UNIQUE INDEX geographical_unit_layer_refid ON chill_main_geographical_unit_layer (refId)');
$this->addSql('CREATE UNIQUE INDEX geographical_unit_refid ON chill_main_geographical_unit (unitRefId)');
$this->addSql('CREATE INDEX chill_internal_geographical_unit_layer_geom_idx ON chill_main_geographical_unit USING GIST (geom)');
}
public function down(Schema $schema): void
{
$this->addSql('DROP INDEX geographical_unit_layer_refid');
$this->addSql('DROP INDEX geographical_unit_refid');
$this->addSql('DROP INDEX chill_internal_geographical_unit_layer_geom_idx');
}
}