migrations/Version20171204151341.php line 1

  1. <?php
  2. namespace DoctrineMigrations;
  3. use Doctrine\DBAL\Schema\Schema;
  4. use Doctrine\Migrations\AbstractMigration;
  5. /**
  6.  * added media.media_name parameter and recreated parameter player_sessionhist.session_id
  7.  */
  8. class Version20171204151341 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('ALTER TABLE media ADD media_name VARCHAR(255) DEFAULT \'\' NOT NULL');
  18.         $this->addSql('ALTER TABLE media ALTER media_name DROP DEFAULT');
  19.         $this->addSql('COMMENT ON COLUMN media.media_name IS \'Name\'');
  20.         $this->addSql('ALTER TABLE player_sessionhist ADD session_id VARCHAR(128) DEFAULT NULL');
  21.     }
  22.     /**
  23.      * @param Schema $schema
  24.      */
  25.     public function down(Schema $schema) : void
  26.     {
  27.         // this down() migration is auto-generated, please modify it to your needs
  28.         $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql''Migration can only be executed safely on \'postgresql\'.');
  29.         //$this->addSql('CREATE SCHEMA public');
  30.         $this->addSql('ALTER TABLE player_sessionhist DROP session_id');
  31.         $this->addSql('ALTER TABLE media DROP media_name');
  32.     }
  33. }