mirror of
https://github.com/wallabag/wallabag.git
synced 2024-11-26 19:11:07 +00:00
Merge pull request #2682 from wallabag/migration-config
Ensure craue_config_setting migration are ok
This commit is contained in:
commit
77e342f75d
4 changed files with 52 additions and 4 deletions
|
@ -29,8 +29,25 @@ class Version20160911214952 extends AbstractMigration implements ContainerAwareI
|
|||
*/
|
||||
public function up(Schema $schema)
|
||||
{
|
||||
$this->addSql('INSERT INTO '.$this->getTable('craue_config_setting')." (name, value, section) VALUES ('import_with_redis', 0, 'import')");
|
||||
$this->addSql('INSERT INTO '.$this->getTable('craue_config_setting')." (name, value, section) VALUES ('import_with_rabbitmq', 0, 'import')");
|
||||
$redis = $this->container
|
||||
->get('doctrine.orm.default_entity_manager')
|
||||
->getConnection()
|
||||
->fetchArray('SELECT * FROM '.$this->getTable('craue_config_setting')." WHERE name = 'import_with_redis'");
|
||||
|
||||
if (false === $redis) {
|
||||
$this->addSql('INSERT INTO '.$this->getTable('craue_config_setting')." (name, value, section) VALUES ('import_with_redis', 0, 'import')");
|
||||
}
|
||||
|
||||
$rabbitmq = $this->container
|
||||
->get('doctrine.orm.default_entity_manager')
|
||||
->getConnection()
|
||||
->fetchArray('SELECT * FROM '.$this->getTable('craue_config_setting')." WHERE name = 'import_with_rabbitmq'");
|
||||
|
||||
if (false === $rabbitmq) {
|
||||
$this->addSql('INSERT INTO '.$this->getTable('craue_config_setting')." (name, value, section) VALUES ('import_with_rabbitmq', 0, 'import')");
|
||||
}
|
||||
|
||||
$this->skipIf(false !== $rabbitmq && false !== $redis, 'It seems that you already played this migration.');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -29,6 +29,13 @@ class Version20161031132655 extends AbstractMigration implements ContainerAwareI
|
|||
*/
|
||||
public function up(Schema $schema)
|
||||
{
|
||||
$images = $this->container
|
||||
->get('doctrine.orm.default_entity_manager')
|
||||
->getConnection()
|
||||
->fetchArray('SELECT * FROM '.$this->getTable('craue_config_setting')." WHERE name = 'download_images_enabled'");
|
||||
|
||||
$this->skipIf(false !== $images, 'It seems that you already played this migration.');
|
||||
|
||||
$this->addSql('INSERT INTO "'.$this->getTable('craue_config_setting')."\" (name, value, section) VALUES ('download_images_enabled', 0, 'misc')");
|
||||
}
|
||||
|
||||
|
|
|
@ -29,8 +29,25 @@ class Version20161117071626 extends AbstractMigration implements ContainerAwareI
|
|||
*/
|
||||
public function up(Schema $schema)
|
||||
{
|
||||
$this->addSql('INSERT INTO '.$this->getTable('craue_config_setting')." (name, value, section) VALUES ('share_unmark', 0, 'entry')");
|
||||
$this->addSql('INSERT INTO '.$this->getTable('craue_config_setting')." (name, value, section) VALUES ('unmark_url', 'https://unmark.it', 'entry')");
|
||||
$share = $this->container
|
||||
->get('doctrine.orm.default_entity_manager')
|
||||
->getConnection()
|
||||
->fetchArray('SELECT * FROM '.$this->getTable('craue_config_setting')." WHERE name = 'share_unmark'");
|
||||
|
||||
if (false === $share) {
|
||||
$this->addSql('INSERT INTO '.$this->getTable('craue_config_setting')." (name, value, section) VALUES ('share_unmark', 0, 'entry')");
|
||||
}
|
||||
|
||||
$unmark = $this->container
|
||||
->get('doctrine.orm.default_entity_manager')
|
||||
->getConnection()
|
||||
->fetchArray('SELECT * FROM '.$this->getTable('craue_config_setting')." WHERE name = 'unmark_url'");
|
||||
|
||||
if (false === $unmark) {
|
||||
$this->addSql('INSERT INTO '.$this->getTable('craue_config_setting')." (name, value, section) VALUES ('unmark_url', 'https://unmark.it', 'entry')");
|
||||
}
|
||||
|
||||
$this->skipIf(false !== $share && false !== $unmark, 'It seems that you already played this migration.');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -32,6 +32,13 @@ class Version20161122144743 extends AbstractMigration implements ContainerAwareI
|
|||
*/
|
||||
public function up(Schema $schema)
|
||||
{
|
||||
$access = $this->container
|
||||
->get('doctrine.orm.default_entity_manager')
|
||||
->getConnection()
|
||||
->fetchArray('SELECT * FROM '.$this->getTable('craue_config_setting')." WHERE name = 'restricted_access'");
|
||||
|
||||
$this->skipIf(false !== $access, 'It seems that you already played this migration.');
|
||||
|
||||
$this->addSql('INSERT INTO '.$this->getTable('craue_config_setting')." (name, value, section) VALUES ('restricted_access', 0, 'entry')");
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue