migrations/Version20171205101911.php line 1

  1. <?php
  2. namespace DoctrineMigrations;
  3. use Doctrine\DBAL\Schema\Schema;
  4. use Doctrine\Migrations\AbstractMigration;
  5. /**
  6.  * Auto-generated Migration: Please modify to your needs!
  7.  */
  8. class Version20171205101911 extends AbstractMigration
  9. {
  10.     /**
  11.      * @param Schema $schema
  12.      */
  13.     public function up(Schema $schema) : void
  14.     {
  15.         // this up() migration is auto-generated, please modify it to your needs
  16.         $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql''Migration can only be executed safely on \'postgresql\'.');
  17.      //   $this->addSql('DROP SEQUENCE seq_news_cat_id CASCADE');
  18.     //    $this->addSql('DROP SEQUENCE seq_news_id CASCADE');
  19.    //     $this->addSql('ALTER TABLE media ADD media_name VARCHAR(255) NOT NULL');
  20.     //    $this->addSql('COMMENT ON COLUMN media.media_name IS \'Name\'');
  21.         $this->addSql('ALTER TABLE player_sessionhist ALTER session_id TYPE VARCHAR(128)');
  22.         $this->addSql('ALTER TABLE scenario ADD author TEXT DEFAULT NULL');
  23.         $this->addSql('ALTER TABLE scenario ADD publicated_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL');
  24.         $this->addSql('COMMENT ON COLUMN scenario.author IS \'Author\'');
  25.         $this->addSql('COMMENT ON COLUMN scenario.publicated_at IS \'Publicated at\'');
  26.     }
  27.     /**
  28.      * @param Schema $schema
  29.      */
  30.     public function down(Schema $schema) : void
  31.     {
  32.         // this down() migration is auto-generated, please modify it to your needs
  33.         $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql''Migration can only be executed safely on \'postgresql\'.');
  34.     //    $this->addSql('CREATE SCHEMA public');
  35.        // $this->addSql('CREATE SEQUENCE seq_news_cat_id INCREMENT BY 1 MINVALUE 1 START 1');
  36.         //$this->addSql('CREATE SEQUENCE seq_news_id INCREMENT BY 1 MINVALUE 1 START 1');
  37.     //    $this->addSql('ALTER TABLE media DROP media_name');
  38.         $this->addSql('ALTER TABLE scenario DROP author');
  39.         $this->addSql('ALTER TABLE scenario DROP publicated_at');
  40.         $this->addSql('ALTER TABLE player_sessionhist ALTER session_id TYPE VARCHAR(132)');
  41.     }
  42. }