migrations/Version20200424090622.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 Version20200424090622 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->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql''Migration can only be executed safely on \'postgresql\'.');
  19.         $this->addSql('ALTER TABLE measurement_settings ADD line_type_group_id INT DEFAULT NULL');
  20.         $this->addSql('ALTER TABLE measurement_settings ADD CONSTRAINT FK_D608BD64AB40EAD2 FOREIGN KEY (line_type_group_id) REFERENCES line_type_groups (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
  21.         $this->addSql('CREATE INDEX IDX_D608BD64AB40EAD2 ON measurement_settings (line_type_group_id)');
  22.     }
  23.     public function down(Schema $schema) : void
  24.     {
  25.         // this down() migration is auto-generated, please modify it to your needs
  26.         $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql''Migration can only be executed safely on \'postgresql\'.');
  27.         $this->addSql('CREATE SCHEMA public');
  28.         $this->addSql('CREATE TABLE data_sample_added_queue (id BIGSERIAL NOT NULL, body TEXT NOT NULL, headers TEXT NOT NULL, queue_name VARCHAR(255) NOT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, available_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, delivered_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, PRIMARY KEY(id))');
  29.         $this->addSql('CREATE INDEX idx_bc650a7ce3bd61ce ON data_sample_added_queue (available_at)');
  30.         $this->addSql('CREATE INDEX idx_bc650a7c16ba31db ON data_sample_added_queue (delivered_at)');
  31.         $this->addSql('CREATE INDEX idx_bc650a7cfb7336f0 ON data_sample_added_queue (queue_name)');
  32.         $this->addSql('ALTER TABLE measurement_settings DROP CONSTRAINT FK_D608BD64AB40EAD2');
  33.         $this->addSql('DROP INDEX IDX_D608BD64AB40EAD2');
  34.         $this->addSql('ALTER TABLE measurement_settings DROP line_type_group_id');
  35.     }
  36. }