aboutsummaryrefslogtreecommitdiffhomepage
path: root/app/DoctrineMigrations/Version20170606155640.php
diff options
context:
space:
mode:
authorJérémy Benoist <j0k3r@users.noreply.github.com>2017-07-03 13:39:54 +0200
committerGitHub <noreply@github.com>2017-07-03 13:39:54 +0200
commit71e1cbc8eb5928d393b0772055d6b711e90a09b3 (patch)
tree71795eadcf13fda9198b8cd9a3da26d51826bbd9 /app/DoctrineMigrations/Version20170606155640.php
parent822c877949aff8ae57677671115f8f4fc69588d5 (diff)
parent38520658addc217f127b0627ea28dcf8d6e6178c (diff)
downloadwallabag-71e1cbc8eb5928d393b0772055d6b711e90a09b3.tar.gz
wallabag-71e1cbc8eb5928d393b0772055d6b711e90a09b3.tar.zst
wallabag-71e1cbc8eb5928d393b0772055d6b711e90a09b3.zip
Merge pull request #3258 from wallabag/cs-fixer
Add a real configuration for CS-Fixer
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}