migrations/Version20171110094051.php line 1

  1. <?php
  2. namespace DoctrineMigrations;
  3. use Doctrine\DBAL\Schema\Schema;
  4. use Doctrine\Migrations\AbstractMigration;
  5. /**
  6.  * Add some comments into SCENARIO.
  7.  */
  8. class Version20171110094051 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('COMMENT ON COLUMN scenario.users_id IS \'id of creating/editing user\'');
  18.         $this->addSql('COMMENT ON COLUMN scenario.title IS \'Title of scenario\'');
  19.         $this->addSql('COMMENT ON COLUMN scenario.summary_intro IS \'First information about scenario\'');
  20.         $this->addSql('COMMENT ON COLUMN scenario.summary_epilog IS \'Information after completing scenario\'');
  21.         $this->addSql('COMMENT ON COLUMN scenario.is_deleted IS \'soft delete\'');
  22.         $this->addSql('COMMENT ON COLUMN scenario.created_at IS \'Created at: should be now\'');
  23.         $this->addSql('COMMENT ON COLUMN scenario.lastmod_at IS \'Last modified at: should be now\'');
  24.     }
  25.     /**
  26.      * @param Schema $schema
  27.      */
  28.     public function down(Schema $schema) : void
  29.     {
  30.         // this down() migration is auto-generated, please modify it to your needs
  31.         $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql''Migration can only be executed safely on \'postgresql\'.');
  32.         //$this->addSql('CREATE SCHEMA public');
  33.         $this->addSql('COMMENT ON COLUMN scenario.users_id IS NULL');
  34.         $this->addSql('COMMENT ON COLUMN scenario.title IS NULL');
  35.         $this->addSql('COMMENT ON COLUMN scenario.summary_intro IS NULL');
  36.         $this->addSql('COMMENT ON COLUMN scenario.summary_epilog IS NULL');
  37.         $this->addSql('COMMENT ON COLUMN scenario.is_deleted IS NULL');
  38.         $this->addSql('COMMENT ON COLUMN scenario.created_at IS NULL');
  39.         $this->addSql('COMMENT ON COLUMN scenario.lastmod_at IS NULL');
  40.     }
  41. }