migrations/Version20171204151341.php line 1
<?php
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* added media.media_name parameter and recreated parameter player_sessionhist.session_id
*/
class Version20171204151341 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 media ADD media_name VARCHAR(255) DEFAULT \'\' NOT NULL');
$this->addSql('ALTER TABLE media ALTER media_name DROP DEFAULT');
$this->addSql('COMMENT ON COLUMN media.media_name IS \'Name\'');
$this->addSql('ALTER TABLE player_sessionhist ADD session_id VARCHAR(128) DEFAULT NULL');
}
/**
* @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 player_sessionhist DROP session_id');
$this->addSql('ALTER TABLE media DROP media_name');
}
}