We now can run the migration every time, new line from `craue_config_setting` are properly checked.
*/
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.');
}
/**
*/
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')");
}
*/
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.');
}
/**
*/
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')");
}