migrations/Version20171110130247.php line 1

  1. <?php
  2. namespace DoctrineMigrations;
  3. use Doctrine\DBAL\Schema\Schema;
  4. use Doctrine\Migrations\AbstractMigration;
  5. /**
  6.  * Add comments for MEDIA + !!!!    add "salt" for passwords    !!!!
  7.  */
  8. class Version20171110130247 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 media.scenario_id IS \'Scenario\'');
  18.         $this->addSql('COMMENT ON COLUMN media.node_id IS \'Node\'');
  19.         $this->addSql('COMMENT ON COLUMN media.link_id IS \'Link\'');
  20.         $this->addSql('COMMENT ON COLUMN media.mcq_id IS \'MCQ\'');
  21.         $this->addSql('COMMENT ON COLUMN media.node_priority IS \'Priority in node\'');
  22.         $this->addSql('COMMENT ON COLUMN media.active IS \'Active (0 - off, 1 - on)\'');
  23.         $this->addSql('COMMENT ON COLUMN media.is_deleted IS \'Deleted?\'');
  24.         $this->addSql('COMMENT ON COLUMN media.created_at IS \'Created at\'');
  25.         $this->addSql('ALTER TABLE users ALTER salt SET DEFAULT \'tmpSolution\'');
  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('COMMENT ON COLUMN media.scenario_id IS NULL');
  36.         $this->addSql('COMMENT ON COLUMN media.node_id IS NULL');
  37.         $this->addSql('COMMENT ON COLUMN media.link_id IS NULL');
  38.         $this->addSql('COMMENT ON COLUMN media.mcq_id IS NULL');
  39.         $this->addSql('COMMENT ON COLUMN media.node_priority IS NULL');
  40.         $this->addSql('COMMENT ON COLUMN media.active IS NULL');
  41.         $this->addSql('COMMENT ON COLUMN media.is_deleted IS NULL');
  42.         $this->addSql('COMMENT ON COLUMN media.created_at IS NULL');
  43.         $this->addSql('ALTER TABLE users ALTER salt DROP DEFAULT');
  44.     }
  45. }