migrations/Version20180102143200.php line 1
<?php
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* added columns parameters and parameters_structure to scenario table
*/
class Version20180102143200 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
$this->addSql('ALTER TABLE scenario ADD parameters BOOLEAN DEFAULT \'false\' NOT NULL');
$this->addSql('ALTER TABLE scenario ADD parameters_structure JSON DEFAULT NULL');
$this->addSql('COMMENT ON COLUMN scenario.parameters IS \'Will be parameters in this scenario?\'');
$this->addSql('COMMENT ON COLUMN scenario.parameters_structure IS \'Parameters of patient (json like {\'\'par_name1\'\':\'\'type1\'\', ...})\'');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
//$this->addSql('CREATE SCHEMA public');
$this->addSql('ALTER TABLE scenario DROP parameters');
$this->addSql('ALTER TABLE scenario DROP parameters_structure');
}
}