migrations/Version20221103112158.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. /**
  7.  * Auto-generated Migration: Please modify to your needs!
  8.  */
  9. final class Version20221103112158 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return '';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         // this up() migration is auto-generated, please modify it to your needs
  18.         $this->addSql('CREATE SEQUENCE config_geo_layers_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
  19.         $this->addSql('CREATE TABLE config_geo_layers (id INT NOT NULL, fk_config_id INT DEFAULT NULL, fk_layers_id INT DEFAULT NULL, style VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id))');
  20.         $this->addSql('CREATE INDEX IDX_15504E084582D113 ON config_geo_layers (fk_config_id)');
  21.         $this->addSql('CREATE INDEX IDX_15504E086317BA45 ON config_geo_layers (fk_layers_id)');
  22.         $this->addSql('ALTER TABLE config_geo_layers ADD CONSTRAINT FK_15504E084582D113 FOREIGN KEY (fk_config_id) REFERENCES config_geo_server (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
  23.         $this->addSql('ALTER TABLE config_geo_layers ADD CONSTRAINT FK_15504E086317BA45 FOREIGN KEY (fk_layers_id) REFERENCES layers (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
  24.         //$this->addSql('DROP TABLE buildings');
  25.     }
  26.     public function down(Schema $schema): void
  27.     {
  28.         // this down() migration is auto-generated, please modify it to your needs
  29.         $this->addSql('CREATE SCHEMA public');
  30.         $this->addSql('DROP SEQUENCE config_geo_layers_id_seq CASCADE');
  31.         //$this->addSql('CREATE TABLE buildings (inspireid VARCHAR(14) DEFAULT NULL, adminunit INT DEFAULT NULL, censalsection VARCHAR(10) DEFAULT NULL, currentuse VARCHAR(255) DEFAULT NULL, conditionofconstruction VARCHAR(255) DEFAULT NULL, beginningofconstruction DATE DEFAULT NULL, endofconstruction DATE DEFAULT NULL, numberofdwellings INT DEFAULT NULL, grossfloorarea INT DEFAULT NULL, num_floors INT DEFAULT NULL, num_walls BIGINT DEFAULT NULL, isolated INT DEFAULT NULL, num_neighbors INT DEFAULT NULL, non_exposed_area DOUBLE PRECISION DEFAULT NULL, non_exposed_length DOUBLE PRECISION DEFAULT NULL, num_holes INT DEFAULT NULL, per_hole DOUBLE PRECISION DEFAULT NULL, area DOUBLE PRECISION DEFAULT NULL, perimeter DOUBLE PRECISION DEFAULT NULL, convexity DOUBLE PRECISION DEFAULT NULL, elongation DOUBLE PRECISION DEFAULT NULL, factorforma DOUBLE PRECISION DEFAULT NULL, propcerrverticales DOUBLE PRECISION DEFAULT NULL, surface geometry(GEOMETRY, 0) DEFAULT NULL, compactness DOUBLE PRECISION DEFAULT NULL, propcerrhorizontales DOUBLE PRECISION DEFAULT NULL, habitantes DOUBLE PRECISION DEFAULT NULL, equipamientos_cercanos BIGINT DEFAULT NULL)');
  32.         $this->addSql('DROP TABLE config_geo_layers');
  33.     }
  34. }