migrations/Version20171110122953.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 Version20171110122953 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.category IS \'Category (1 - picture, 2 - video...)\'');
  18.         $this->addSql('COMMENT ON COLUMN media.filename IS \'Filename\'');
  19.         $this->addSql('ALTER TABLE node ALTER scenario_id SET NOT NULL');
  20.         $this->addSql('COMMENT ON COLUMN node.scenario_id IS \'Scenario\'');
  21.         $this->addSql('COMMENT ON COLUMN node.title IS \'Title\'');
  22.         $this->addSql('COMMENT ON COLUMN node.description IS \'Description\'');
  23.         $this->addSql('COMMENT ON COLUMN node.links_order IS \'Order (0 - default, 1 - random)\'');
  24.         $this->addSql('COMMENT ON COLUMN node.parameters IS \'Parameters of patient (json)\'');
  25.         $this->addSql('COMMENT ON COLUMN node.priority IS \'Priority (0 - is last in order)\'');
  26.         $this->addSql('COMMENT ON COLUMN node.active IS \'Active (0 - off, 1 - on)\'');
  27.         $this->addSql('COMMENT ON COLUMN node.is_deleted IS \'Deleted?\'');
  28.         $this->addSql('COMMENT ON COLUMN node.created_at IS \'Created at\'');
  29.         $this->addSql('ALTER TABLE player_sessionhist DROP session_id');
  30.         $this->addSql('COMMENT ON COLUMN users.username IS \'Username\'');
  31.         $this->addSql('COMMENT ON COLUMN users.password IS \'Password\'');
  32.         $this->addSql('COMMENT ON COLUMN users.first_name IS \'First name\'');
  33.         $this->addSql('COMMENT ON COLUMN users.last_name IS \'Last name\'');
  34.         $this->addSql('COMMENT ON COLUMN users.email IS \'Email\'');
  35.         $this->addSql('COMMENT ON COLUMN users.phone IS \'Phone\'');
  36.         $this->addSql('COMMENT ON COLUMN users.institution IS \'Institution\'');
  37.         $this->addSql('COMMENT ON COLUMN users.address IS \'Address\'');
  38.         $this->addSql('COMMENT ON COLUMN users.city IS \'City\'');
  39.         $this->addSql('COMMENT ON COLUMN users.postalcode IS \'Postal code\'');
  40.         $this->addSql('COMMENT ON COLUMN users.settings IS \'Settings N/A\'');
  41.         $this->addSql('COMMENT ON COLUMN users.auth_modules IS \'Modules N/A\'');
  42.         $this->addSql('COMMENT ON COLUMN users.auth_role IS \'Role\'');
  43.         $this->addSql('COMMENT ON COLUMN users.created_at IS \'Created at\'');
  44.         $this->addSql('COMMENT ON COLUMN mcq.node_id IS \'Node\'');
  45.         $this->addSql('COMMENT ON COLUMN mcq.description IS \'Description\'');
  46.         $this->addSql('COMMENT ON COLUMN mcq.options IS \'Options (json)\'');
  47.         $this->addSql('COMMENT ON COLUMN mcq.active IS \'Active (0 - off, 1 - on)\'');
  48.         $this->addSql('COMMENT ON COLUMN mcq.is_deleted IS \'Deleted?\'');
  49.         $this->addSql('COMMENT ON COLUMN mcq.created_at IS \'Created at\'');
  50.         $this->addSql('COMMENT ON COLUMN link.node_id IS \'Node\'');
  51.         $this->addSql('COMMENT ON COLUMN link.description IS \'Description\'');
  52.         $this->addSql('COMMENT ON COLUMN link.feedback IS \'Feedback\'');
  53.         $this->addSql('COMMENT ON COLUMN link.score IS \'Score\'');
  54.         $this->addSql('COMMENT ON COLUMN link.preferred_order IS \'Preferred order:\'');
  55.         $this->addSql('COMMENT ON COLUMN link.correct IS \'Correct (-1 - fatal, 0 -wrong, 1 - correct)\'');
  56.         $this->addSql('COMMENT ON COLUMN link.active IS \'Active (0 - off, 1 - on)\'');
  57.         $this->addSql('COMMENT ON COLUMN link.is_deleted IS \'Deleted?\'');
  58.         $this->addSql('COMMENT ON COLUMN link.created_at IS \'Created at\'');
  59.         $this->addSql('COMMENT ON COLUMN scenario.users_id IS \'Creating/editing user\'');
  60.         $this->addSql('COMMENT ON COLUMN scenario.title IS \'Title\'');
  61.         $this->addSql('COMMENT ON COLUMN scenario.summary_intro IS \'Perex/annotation\'');
  62.         $this->addSql('COMMENT ON COLUMN scenario.summary_epilog IS \'Epilog summary\'');
  63.         $this->addSql('COMMENT ON COLUMN scenario.state IS \'State (0 - off, 1 - on)\'');
  64.         $this->addSql('COMMENT ON COLUMN scenario.is_deleted IS \'Deleted?\'');
  65.         $this->addSql('COMMENT ON COLUMN scenario.created_at IS \'Created at\'');
  66.         $this->addSql('COMMENT ON COLUMN scenario.lastmod_at IS NULL');
  67.     }
  68.     /**
  69.      * @param Schema $schema
  70.      */
  71.     public function down(Schema $schema) : void
  72.     {
  73.         // this down() migration is auto-generated, please modify it to your needs
  74.         $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql''Migration can only be executed safely on \'postgresql\'.');
  75.         //$this->addSql('CREATE SCHEMA public');
  76.         $this->addSql('ALTER TABLE player_sessionhist ADD session_id VARCHAR(64) DEFAULT NULL');
  77.         $this->addSql('COMMENT ON COLUMN media.category IS NULL');
  78.         $this->addSql('COMMENT ON COLUMN media.filename IS NULL');
  79.         $this->addSql('COMMENT ON COLUMN users.username IS NULL');
  80.         $this->addSql('COMMENT ON COLUMN users.password IS NULL');
  81.         $this->addSql('COMMENT ON COLUMN users.first_name IS NULL');
  82.         $this->addSql('COMMENT ON COLUMN users.last_name IS NULL');
  83.         $this->addSql('COMMENT ON COLUMN users.email IS NULL');
  84.         $this->addSql('COMMENT ON COLUMN users.phone IS NULL');
  85.         $this->addSql('COMMENT ON COLUMN users.institution IS NULL');
  86.         $this->addSql('COMMENT ON COLUMN users.address IS NULL');
  87.         $this->addSql('COMMENT ON COLUMN users.city IS NULL');
  88.         $this->addSql('COMMENT ON COLUMN users.postalcode IS NULL');
  89.         $this->addSql('COMMENT ON COLUMN users.settings IS NULL');
  90.         $this->addSql('COMMENT ON COLUMN users.auth_modules IS NULL');
  91.         $this->addSql('COMMENT ON COLUMN users.auth_role IS NULL');
  92.         $this->addSql('COMMENT ON COLUMN users.created_at IS NULL');
  93.         $this->addSql('COMMENT ON COLUMN mcq.node_id IS NULL');
  94.         $this->addSql('COMMENT ON COLUMN mcq.description IS NULL');
  95.         $this->addSql('COMMENT ON COLUMN mcq.options IS NULL');
  96.         $this->addSql('COMMENT ON COLUMN mcq.active IS NULL');
  97.         $this->addSql('COMMENT ON COLUMN mcq.is_deleted IS NULL');
  98.         $this->addSql('COMMENT ON COLUMN mcq.created_at IS NULL');
  99.         $this->addSql('COMMENT ON COLUMN link.node_id IS NULL');
  100.         $this->addSql('COMMENT ON COLUMN link.description IS NULL');
  101.         $this->addSql('COMMENT ON COLUMN link.feedback IS NULL');
  102.         $this->addSql('COMMENT ON COLUMN link.score IS NULL');
  103.         $this->addSql('COMMENT ON COLUMN link.preferred_order IS NULL');
  104.         $this->addSql('COMMENT ON COLUMN link.correct IS NULL');
  105.         $this->addSql('COMMENT ON COLUMN link.active IS NULL');
  106.         $this->addSql('COMMENT ON COLUMN link.is_deleted IS NULL');
  107.         $this->addSql('COMMENT ON COLUMN link.created_at IS NULL');
  108.         $this->addSql('COMMENT ON COLUMN scenario.users_id IS \'id of creating/editing user\'');
  109.         $this->addSql('COMMENT ON COLUMN scenario.title IS \'Title of scenario\'');
  110.         $this->addSql('COMMENT ON COLUMN scenario.summary_intro IS \'First information about scenario\'');
  111.         $this->addSql('COMMENT ON COLUMN scenario.summary_epilog IS \'Information after completing scenario\'');
  112.         $this->addSql('COMMENT ON COLUMN scenario.state IS NULL');
  113.         $this->addSql('COMMENT ON COLUMN scenario.is_deleted IS \'soft delete\'');
  114.         $this->addSql('COMMENT ON COLUMN scenario.created_at IS \'Created at: should be now\'');
  115.         $this->addSql('COMMENT ON COLUMN scenario.lastmod_at IS \'Last modified at: should be now\'');
  116.         $this->addSql('ALTER TABLE node ALTER scenario_id DROP NOT NULL');
  117.         $this->addSql('COMMENT ON COLUMN node.scenario_id IS NULL');
  118.         $this->addSql('COMMENT ON COLUMN node.title IS NULL');
  119.         $this->addSql('COMMENT ON COLUMN node.description IS NULL');
  120.         $this->addSql('COMMENT ON COLUMN node.links_order IS NULL');
  121.         $this->addSql('COMMENT ON COLUMN node.parameters IS NULL');
  122.         $this->addSql('COMMENT ON COLUMN node.priority IS NULL');
  123.         $this->addSql('COMMENT ON COLUMN node.active IS NULL');
  124.         $this->addSql('COMMENT ON COLUMN node.is_deleted IS NULL');
  125.         $this->addSql('COMMENT ON COLUMN node.created_at IS NULL');
  126.     }
  127. }