aboutsummaryrefslogtreecommitdiffhomepage
path: root/app/DoctrineMigrations/Version20170606155640.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/DoctrineMigrations/Version20170606155640.php')
-rw-r--r--app/DoctrineMigrations/Version20170606155640.php18
1 files changed, 9 insertions, 9 deletions
diff --git a/app/DoctrineMigrations/Version20170606155640.php b/app/DoctrineMigrations/Version20170606155640.php
index e9b50428..5f58fc29 100644
--- a/app/DoctrineMigrations/Version20170606155640.php
+++ b/app/DoctrineMigrations/Version20170606155640.php
@@ -9,7 +9,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
9 9
10/** 10/**
11 * Remove wallabag_url from craue_config_setting. 11 * Remove wallabag_url from craue_config_setting.
12 * It has been moved into the parameters.yml 12 * It has been moved into the parameters.yml.
13 */ 13 */
14class Version20170606155640 extends AbstractMigration implements ContainerAwareInterface 14class Version20170606155640 extends AbstractMigration implements ContainerAwareInterface
15{ 15{
@@ -23,11 +23,6 @@ class Version20170606155640 extends AbstractMigration implements ContainerAwareI
23 $this->container = $container; 23 $this->container = $container;
24 } 24 }
25 25
26 private function getTable($tableName)
27 {
28 return $this->container->getParameter('database_table_prefix').$tableName;
29 }
30
31 /** 26 /**
32 * @param Schema $schema 27 * @param Schema $schema
33 */ 28 */
@@ -36,11 +31,11 @@ class Version20170606155640 extends AbstractMigration implements ContainerAwareI
36 $apiUserRegistration = $this->container 31 $apiUserRegistration = $this->container
37 ->get('doctrine.orm.default_entity_manager') 32 ->get('doctrine.orm.default_entity_manager')
38 ->getConnection() 33 ->getConnection()
39 ->fetchArray('SELECT * FROM '.$this->getTable('craue_config_setting')." WHERE name = 'wallabag_url'"); 34 ->fetchArray('SELECT * FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'wallabag_url'");
40 35
41 $this->skipIf(false === $apiUserRegistration, 'It seems that you already played this migration.'); 36 $this->skipIf(false === $apiUserRegistration, 'It seems that you already played this migration.');
42 37
43 $this->addSql('DELETE FROM '.$this->getTable('craue_config_setting')." WHERE name = 'wallabag_url'"); 38 $this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'wallabag_url'");
44 } 39 }
45 40
46 /** 41 /**
@@ -48,6 +43,11 @@ class Version20170606155640 extends AbstractMigration implements ContainerAwareI
48 */ 43 */
49 public function down(Schema $schema) 44 public function down(Schema $schema)
50 { 45 {
51 $this->addSql('INSERT INTO '.$this->getTable('craue_config_setting')." (name, value, section) VALUES ('wallabag_url', 'wallabag.me', 'misc')"); 46 $this->addSql('INSERT INTO ' . $this->getTable('craue_config_setting') . " (name, value, section) VALUES ('wallabag_url', 'wallabag.me', 'misc')");
47 }
48
49 private function getTable($tableName)
50 {
51 return $this->container->getParameter('database_table_prefix') . $tableName;
52 } 52 }
53} 53}