migrations/Version20200424145128.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 Version20200424145128 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 line_types ADD pattern TEXT NOT NULL');
  20.         $this->addSql('COMMENT ON COLUMN line_types.pattern IS \'Pattern.\'');
  21.     }
  22.     public function down(Schema $schema) : void
  23.     {
  24.         // this down() migration is auto-generated, please modify it to your needs
  25.         $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql''Migration can only be executed safely on \'postgresql\'.');
  26.         $this->addSql('CREATE SCHEMA public');
  27.         $this->addSql('CREATE SEQUENCE data_sample_added_queue_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
  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_bc650a7cfb7336f0 ON data_sample_added_queue (queue_name)');
  30.         $this->addSql('CREATE INDEX idx_bc650a7ce3bd61ce ON data_sample_added_queue (available_at)');
  31.         $this->addSql('CREATE INDEX idx_bc650a7c16ba31db ON data_sample_added_queue (delivered_at)');
  32.         $this->addSql('ALTER TABLE line_types DROP pattern');
  33.     }
  34. }