<?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 Version20220917144607 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->abortIf(
!$this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\PostgreSQL100Platform,
"Migration can only be executed safely on '\Doctrine\DBAL\Platforms\PostgreSQL100Platform'."
);
$this->addSql('CREATE TABLE filter_options (id INT NOT NULL, fk_config_geo_server_id INT DEFAULT NULL, label VARCHAR(255) DEFAULT NULL, cql VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX idx_67a58de2d1a31eec ON filter_options (fk_config_geo_server_id)');
$this->abortIf(
!$this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\PostgreSQL100Platform,
"Migration can only be executed safely on '\Doctrine\DBAL\Platforms\PostgreSQL100Platform'."
);
$this->addSql('CREATE TABLE filter_range (id INT NOT NULL, cql VARCHAR(255) NOT NULL, comma BOOLEAN NOT NULL, units VARCHAR(255) DEFAULT NULL, range_min INT DEFAULT NULL, range_max INT DEFAULT NULL, default_min INT DEFAULT NULL, default_max INT DEFAULT NULL, PRIMARY KEY(id))');
$this->abortIf(
!$this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\PostgreSQL100Platform,
"Migration can only be executed safely on '\Doctrine\DBAL\Platforms\PostgreSQL100Platform'."
);
$this->addSql('CREATE TABLE config_geo_server (id INT NOT NULL, fk_filter_range_id INT DEFAULT NULL, name VARCHAR(255) NOT NULL, cluster VARCHAR(255) NOT NULL, slug VARCHAR(255) NOT NULL, filter BOOLEAN DEFAULT NULL, type_filter VARCHAR(16) DEFAULT NULL, style VARCHAR(255) DEFAULT NULL, default_value VARCHAR(255) DEFAULT NULL, multiple BOOLEAN DEFAULT NULL, "position" INT DEFAULT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX idx_a9b576aece4e8124 ON config_geo_server (fk_filter_range_id)');
$this->abortIf(
!$this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\PostgreSQL100Platform,
"Migration can only be executed safely on '\Doctrine\DBAL\Platforms\PostgreSQL100Platform'."
);
$this->addSql('CREATE TABLE "user" (id INT NOT NULL, email VARCHAR(180) NOT NULL, roles JSON NOT NULL, password VARCHAR(255) NOT NULL, name VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE UNIQUE INDEX uniq_8d93d649e7927c74 ON "user" (email)');
$this->abortIf(
!$this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\PostgreSQL100Platform,
"Migration can only be executed safely on '\Doctrine\DBAL\Platforms\PostgreSQL100Platform'."
);
$this->addSql('CREATE TABLE layers (id INT NOT NULL, name VARCHAR(255) DEFAULT NULL, name_geo_server VARCHAR(255) DEFAULT NULL, static BOOLEAN DEFAULT NULL, zoom_min INT DEFAULT NULL, zoom_max INT DEFAULT NULL, "position" INT DEFAULT NULL, slug VARCHAR(255) DEFAULT NULL, token BOOLEAN DEFAULT NULL, auth_key VARCHAR(255) DEFAULT NULL, opacity DOUBLE PRECISION DEFAULT NULL, PRIMARY KEY(id))');
$this->abortIf(
!$this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\PostgreSQL100Platform,
"Migration can only be executed safely on '\Doctrine\DBAL\Platforms\PostgreSQL100Platform'."
);
$this->addSql('CREATE TABLE styles (id INT NOT NULL, fk_config_geo_server_id INT DEFAULT NULL, label VARCHAR(255) DEFAULT NULL, color VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX idx_b65afaf5d1a31eec ON styles (fk_config_geo_server_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
!$this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\PostgreSQL100Platform,
"Migration can only be executed safely on '\Doctrine\DBAL\Platforms\PostgreSQL100Platform'."
);
$this->addSql('DROP TABLE filter_options');
$this->abortIf(
!$this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\PostgreSQL100Platform,
"Migration can only be executed safely on '\Doctrine\DBAL\Platforms\PostgreSQL100Platform'."
);
$this->addSql('DROP TABLE filter_range');
$this->abortIf(
!$this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\PostgreSQL100Platform,
"Migration can only be executed safely on '\Doctrine\DBAL\Platforms\PostgreSQL100Platform'."
);
$this->addSql('DROP TABLE config_geo_server');
$this->abortIf(
!$this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\PostgreSQL100Platform,
"Migration can only be executed safely on '\Doctrine\DBAL\Platforms\PostgreSQL100Platform'."
);
$this->addSql('DROP TABLE "user"');
$this->abortIf(
!$this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\PostgreSQL100Platform,
"Migration can only be executed safely on '\Doctrine\DBAL\Platforms\PostgreSQL100Platform'."
);
$this->addSql('DROP TABLE layers');
$this->abortIf(
!$this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\PostgreSQL100Platform,
"Migration can only be executed safely on '\Doctrine\DBAL\Platforms\PostgreSQL100Platform'."
);
$this->addSql('DROP TABLE styles');
}
}