Fix migrations

This commit is contained in:
Jeremy Benoist
2016-10-23 12:35:57 +02:00
parent 88d5d94dcb
commit 5ce1528953
6 changed files with 48 additions and 28 deletions

View File

@ -30,7 +30,7 @@ class Version20160916201049 extends AbstractMigration implements ContainerAwareI
public function up(Schema $schema)
{
$this->addSql('ALTER TABLE '.$this->getTable('config').' ADD pocket_consumer_key VARCHAR(255) DEFAULT NULL');
$this->addSql("DELETE FROM `".$this->getTable('craue_config_setting')."` WHERE `name` = 'pocket_consumer_key';");
$this->addSql("DELETE FROM ".$this->getTable('craue_config_setting')." WHERE name = 'pocket_consumer_key';");
}
/**
@ -40,7 +40,7 @@ class Version20160916201049 extends AbstractMigration implements ContainerAwareI
{
$this->abortIf($this->connection->getDatabasePlatform()->getName() == 'sqlite', 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.');
$this->addSql('ALTER TABLE `'.$this->getTable('config').'` DROP pocket_consumer_key');
$this->addSql("INSERT INTO `".$this->getTable('craue_config_setting')."` (`name`, `value`, `section`) VALUES ('pocket_consumer_key', NULL, 'import')");
$this->addSql('ALTER TABLE '.$this->getTable('config').' DROP pocket_consumer_key');
$this->addSql("INSERT INTO ".$this->getTable('craue_config_setting')." (name, value, section) VALUES ('pocket_consumer_key', NULL, 'import')");
}
}