From 9c545fe028013b30417c1a932cd6b9027bff752d Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Sat, 21 May 2016 18:09:38 +0200 Subject: Added name on client - Fix typos in field name - Added migration for name field in API client table Manually cherry-picked from PR https://github.com/wallabag/wallabag/pull/2171 --- app/DoctrineMigrations/Version20160812120952.php | 27 ++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 app/DoctrineMigrations/Version20160812120952.php (limited to 'app/DoctrineMigrations') diff --git a/app/DoctrineMigrations/Version20160812120952.php b/app/DoctrineMigrations/Version20160812120952.php new file mode 100644 index 00000000..58f070c7 --- /dev/null +++ b/app/DoctrineMigrations/Version20160812120952.php @@ -0,0 +1,27 @@ +addSql('ALTER TABLE wallabag_oauth2_clients ADD name CLOB DEFAULT NULL COLLATE BINARY'); + } + + /** + * @param Schema $schema + */ + public function down(Schema $schema) + { + $this->abortIf($this->connection->getDatabasePlatform()->getName() == 'sqlite', 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.'); + $this->addSql('ALTER TABLE wallabag_oauth2_clients DROP COLUMN name; +'); + } +} -- cgit v1.2.3 From d0545b6bd6edc38bf06604900b1e20a60e7c8583 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Sun, 10 Apr 2016 21:48:11 +0200 Subject: Add migration --- app/DoctrineMigrations/Version20160410190541.php | 26 ++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 app/DoctrineMigrations/Version20160410190541.php (limited to 'app/DoctrineMigrations') diff --git a/app/DoctrineMigrations/Version20160410190541.php b/app/DoctrineMigrations/Version20160410190541.php new file mode 100644 index 00000000..b30a898c --- /dev/null +++ b/app/DoctrineMigrations/Version20160410190541.php @@ -0,0 +1,26 @@ +addSql('ALTER TABLE wallabag_entry ADD uuid LONGTEXT DEFAULT NULL'); + $this->addSql('UPDATE wallabag_entry SET uuid = uuid()'); + } + + /** + * @param Schema $schema + */ + public function down(Schema $schema) + { + $this->addSql('ALTER TABLE `wallabag_entry` DROP uuid'); + } +} -- cgit v1.2.3 From a7e2218e253138ed53e18b4775dce291c78246c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Fri, 15 Apr 2016 13:42:13 +0200 Subject: Add test and fix migration --- app/DoctrineMigrations/Version20160410190541.php | 35 +++++++++++++++++++++--- 1 file changed, 31 insertions(+), 4 deletions(-) (limited to 'app/DoctrineMigrations') diff --git a/app/DoctrineMigrations/Version20160410190541.php b/app/DoctrineMigrations/Version20160410190541.php index b30a898c..775dd680 100644 --- a/app/DoctrineMigrations/Version20160410190541.php +++ b/app/DoctrineMigrations/Version20160410190541.php @@ -4,16 +4,43 @@ namespace Application\Migrations; use Doctrine\DBAL\Migrations\AbstractMigration; use Doctrine\DBAL\Schema\Schema; +use Symfony\Component\DependencyInjection\ContainerAwareInterface; +use Symfony\Component\DependencyInjection\ContainerInterface; +use Wallabag\CoreBundle\Entity\Entry; -class Version20160410190541 extends AbstractMigration +class Version20160410190541 extends AbstractMigration implements ContainerAwareInterface { + /** + * @var ContainerInterface + */ + private $container; + + public function setContainer(ContainerInterface $container = null) + { + $this->container = $container; + } + /** * @param Schema $schema */ public function up(Schema $schema) { - $this->addSql('ALTER TABLE wallabag_entry ADD uuid LONGTEXT DEFAULT NULL'); - $this->addSql('UPDATE wallabag_entry SET uuid = uuid()'); + $this->addSql('ALTER TABLE `wallabag_entry` ADD `uuid` LONGTEXT DEFAULT NULL'); + + $em = $this->container->get('doctrine.orm.entity_manager'); + $queryBuilder = $this->connection->createQueryBuilder(); + $queryBuilder + ->select('e.uuid') + ->andWhere('e.uuid IS NULL'); + $entries = $queryBuilder->execute(); + + /** @var Entry $entry */ + foreach ($entries as $entry) { + $entry->generateUuid(); + $em->persist($entry); + $em->clear(); + } + $em->flush(); } /** @@ -21,6 +48,6 @@ class Version20160410190541 extends AbstractMigration */ public function down(Schema $schema) { - $this->addSql('ALTER TABLE `wallabag_entry` DROP uuid'); + $this->addSql('ALTER TABLE `wallabag_entry` DROP `uuid`'); } } -- cgit v1.2.3 From 9a5231e8c424bf92c164c9bd27a9660c17cc7852 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Mon, 18 Apr 2016 22:45:52 +0200 Subject: Improve migration --- app/DoctrineMigrations/Version20160410190541.php | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'app/DoctrineMigrations') diff --git a/app/DoctrineMigrations/Version20160410190541.php b/app/DoctrineMigrations/Version20160410190541.php index 775dd680..f35f54ce 100644 --- a/app/DoctrineMigrations/Version20160410190541.php +++ b/app/DoctrineMigrations/Version20160410190541.php @@ -26,21 +26,18 @@ class Version20160410190541 extends AbstractMigration implements ContainerAwareI public function up(Schema $schema) { $this->addSql('ALTER TABLE `wallabag_entry` ADD `uuid` LONGTEXT DEFAULT NULL'); + } + public function postUp(Schema $schema) + { $em = $this->container->get('doctrine.orm.entity_manager'); - $queryBuilder = $this->connection->createQueryBuilder(); - $queryBuilder - ->select('e.uuid') - ->andWhere('e.uuid IS NULL'); - $entries = $queryBuilder->execute(); + $repository = $em->getRepository('WallabagCoreBundle:Entry'); + $entries = $repository->findAll(); /** @var Entry $entry */ foreach ($entries as $entry) { - $entry->generateUuid(); - $em->persist($entry); - $em->clear(); + $this->addSql('UPDATE `wallabag_entry` SET `uuid` = "'.uniqid('', true).'" WHERE id = '.$entry->getId()); } - $em->flush(); } /** @@ -48,6 +45,7 @@ class Version20160410190541 extends AbstractMigration implements ContainerAwareI */ public function down(Schema $schema) { + $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'sqlite', 'This down migration can\'t be executed on SQLite databases, because SQLite don\'t support DROP COLUMN.'); $this->addSql('ALTER TABLE `wallabag_entry` DROP `uuid`'); } } -- cgit v1.2.3 From f1be7af446052c6fed7033664c6c6350f558961b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Tue, 23 Aug 2016 16:49:12 +0200 Subject: Change share entry behavior --- app/DoctrineMigrations/Version20160410190541.php | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'app/DoctrineMigrations') diff --git a/app/DoctrineMigrations/Version20160410190541.php b/app/DoctrineMigrations/Version20160410190541.php index f35f54ce..77c78c54 100644 --- a/app/DoctrineMigrations/Version20160410190541.php +++ b/app/DoctrineMigrations/Version20160410190541.php @@ -28,18 +28,6 @@ class Version20160410190541 extends AbstractMigration implements ContainerAwareI $this->addSql('ALTER TABLE `wallabag_entry` ADD `uuid` LONGTEXT DEFAULT NULL'); } - public function postUp(Schema $schema) - { - $em = $this->container->get('doctrine.orm.entity_manager'); - $repository = $em->getRepository('WallabagCoreBundle:Entry'); - $entries = $repository->findAll(); - - /** @var Entry $entry */ - foreach ($entries as $entry) { - $this->addSql('UPDATE `wallabag_entry` SET `uuid` = "'.uniqid('', true).'" WHERE id = '.$entry->getId()); - } - } - /** * @param Schema $schema */ -- cgit v1.2.3 From ad9304cd7ed139dc59d6f40e6f8f4adcc6923c80 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Wed, 24 Aug 2016 21:38:26 +0200 Subject: Handle table prefix in migration and fix migration for name field in oauth table --- app/DoctrineMigrations/Version20160410190541.php | 11 ++++++++--- app/DoctrineMigrations/Version20160812120952.php | 25 ++++++++++++++++++++---- 2 files changed, 29 insertions(+), 7 deletions(-) (limited to 'app/DoctrineMigrations') diff --git a/app/DoctrineMigrations/Version20160410190541.php b/app/DoctrineMigrations/Version20160410190541.php index 77c78c54..5030d9c2 100644 --- a/app/DoctrineMigrations/Version20160410190541.php +++ b/app/DoctrineMigrations/Version20160410190541.php @@ -6,7 +6,6 @@ use Doctrine\DBAL\Migrations\AbstractMigration; use Doctrine\DBAL\Schema\Schema; use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Symfony\Component\DependencyInjection\ContainerInterface; -use Wallabag\CoreBundle\Entity\Entry; class Version20160410190541 extends AbstractMigration implements ContainerAwareInterface { @@ -20,12 +19,17 @@ class Version20160410190541 extends AbstractMigration implements ContainerAwareI $this->container = $container; } + private function getTable($tableName) + { + return $this->container->getParameter('database_table_prefix') . $tableName; + } + /** * @param Schema $schema */ public function up(Schema $schema) { - $this->addSql('ALTER TABLE `wallabag_entry` ADD `uuid` LONGTEXT DEFAULT NULL'); + $this->addSql('ALTER TABLE `'.$this->getTable('entry').'` ADD `uuid` LONGTEXT DEFAULT NULL'); } /** @@ -34,6 +38,7 @@ class Version20160410190541 extends AbstractMigration implements ContainerAwareI public function down(Schema $schema) { $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'sqlite', 'This down migration can\'t be executed on SQLite databases, because SQLite don\'t support DROP COLUMN.'); - $this->addSql('ALTER TABLE `wallabag_entry` DROP `uuid`'); + + $this->addSql('ALTER TABLE `'.$this->getTable('entry').'` DROP `uuid`'); } } diff --git a/app/DoctrineMigrations/Version20160812120952.php b/app/DoctrineMigrations/Version20160812120952.php index 58f070c7..9adfdc8b 100644 --- a/app/DoctrineMigrations/Version20160812120952.php +++ b/app/DoctrineMigrations/Version20160812120952.php @@ -4,15 +4,32 @@ namespace Application\Migrations; use Doctrine\DBAL\Migrations\AbstractMigration; use Doctrine\DBAL\Schema\Schema; +use Symfony\Component\DependencyInjection\ContainerAwareInterface; +use Symfony\Component\DependencyInjection\ContainerInterface; -class Version20160812120952 extends AbstractMigration +class Version20160812120952 extends AbstractMigration implements ContainerAwareInterface { + /** + * @var ContainerInterface + */ + private $container; + + public function setContainer(ContainerInterface $container = null) + { + $this->container = $container; + } + + private function getTable($tableName) + { + return $this->container->getParameter('database_table_prefix') . $tableName; + } + /** * @param Schema $schema */ public function up(Schema $schema) { - $this->addSql('ALTER TABLE wallabag_oauth2_clients ADD name CLOB DEFAULT NULL COLLATE BINARY'); + $this->addSql('ALTER TABLE '.$this->getTable('oauth2_clients').' ADD name longtext COLLATE \'utf8_unicode_ci\' DEFAULT NULL'); } /** @@ -21,7 +38,7 @@ class Version20160812120952 extends AbstractMigration public function down(Schema $schema) { $this->abortIf($this->connection->getDatabasePlatform()->getName() == 'sqlite', 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.'); - $this->addSql('ALTER TABLE wallabag_oauth2_clients DROP COLUMN name; -'); + + $this->addSql('ALTER TABLE '.$this->getTable('oauth2_clients').' DROP COLUMN name'); } } -- cgit v1.2.3 From b1afef30dc5527e5bf57c3eff60b05ee478a6014 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Wed, 24 Aug 2016 21:56:02 +0200 Subject: Handle share_entry - share_entry needs to be in the migration too - and it needs a translation --- app/DoctrineMigrations/Version20160410190541.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'app/DoctrineMigrations') diff --git a/app/DoctrineMigrations/Version20160410190541.php b/app/DoctrineMigrations/Version20160410190541.php index 5030d9c2..4014857b 100644 --- a/app/DoctrineMigrations/Version20160410190541.php +++ b/app/DoctrineMigrations/Version20160410190541.php @@ -30,6 +30,7 @@ class Version20160410190541 extends AbstractMigration implements ContainerAwareI public function up(Schema $schema) { $this->addSql('ALTER TABLE `'.$this->getTable('entry').'` ADD `uuid` LONGTEXT DEFAULT NULL'); + $this->addSql("INSERT INTO `".$this->getTable('craue_config_setting')."` (`name`, `value`, `section`) VALUES ('share_public', '1', 'entry')"); } /** @@ -40,5 +41,6 @@ class Version20160410190541 extends AbstractMigration implements ContainerAwareI $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'sqlite', 'This down migration can\'t be executed on SQLite databases, because SQLite don\'t support DROP COLUMN.'); $this->addSql('ALTER TABLE `'.$this->getTable('entry').'` DROP `uuid`'); + $this->addSql("DELETE FROM `".$this->getTable('craue_config_setting')."` WHERE `name` = 'share_public'"); } } -- cgit v1.2.3 From e01a3c98d6908e95121b5ade0161f40af1b05ca6 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Tue, 13 Sep 2016 20:31:32 +0200 Subject: Display how many messages are queue - update the docker-composer to add Redis - add migrations --- app/DoctrineMigrations/Version20160911214952.php | 42 ++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 app/DoctrineMigrations/Version20160911214952.php (limited to 'app/DoctrineMigrations') diff --git a/app/DoctrineMigrations/Version20160911214952.php b/app/DoctrineMigrations/Version20160911214952.php new file mode 100644 index 00000000..35809cec --- /dev/null +++ b/app/DoctrineMigrations/Version20160911214952.php @@ -0,0 +1,42 @@ +container = $container; + } + + private function getTable($tableName) + { + return $this->container->getParameter('database_table_prefix') . $tableName; + } + + /** + * @param Schema $schema + */ + 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\')'); + } + + /** + * @param Schema $schema + */ + public function down(Schema $schema) + { + } +} -- cgit v1.2.3 From ebe0787e093f4f2934430033015d6ebad1c64dca Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Fri, 16 Sep 2016 22:22:25 +0200 Subject: Moved Pocket token to user config --- app/DoctrineMigrations/Version20160916201049.php | 44 ++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 app/DoctrineMigrations/Version20160916201049.php (limited to 'app/DoctrineMigrations') diff --git a/app/DoctrineMigrations/Version20160916201049.php b/app/DoctrineMigrations/Version20160916201049.php new file mode 100644 index 00000000..ac8e6966 --- /dev/null +++ b/app/DoctrineMigrations/Version20160916201049.php @@ -0,0 +1,44 @@ +container = $container; + } + + private function getTable($tableName) + { + return $this->container->getParameter('database_table_prefix') . $tableName; + } + + /** + * @param Schema $schema + */ + public function up(Schema $schema) + { + $this->addSql('ALTER TABLE '.$this->getTable('config').' ADD pocket_consumer_key VARCHAR(255) DEFAULT NULL'); + } + + /** + * @param Schema $schema + */ + public function down(Schema $schema) + { + $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'); + } +} -- cgit v1.2.3 From fbb319f064e6336a3b44bda12cdc51c93c51f379 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Fri, 16 Sep 2016 22:58:33 +0200 Subject: Missing some migrations and CS --- app/DoctrineMigrations/Version20160916201049.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'app/DoctrineMigrations') diff --git a/app/DoctrineMigrations/Version20160916201049.php b/app/DoctrineMigrations/Version20160916201049.php index ac8e6966..202901e6 100644 --- a/app/DoctrineMigrations/Version20160916201049.php +++ b/app/DoctrineMigrations/Version20160916201049.php @@ -30,6 +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';"); } /** @@ -40,5 +41,6 @@ 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')"); } } -- cgit v1.2.3 From 084fb0d303efc6edd0bfbf43d96b6cbe48acb2b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Wed, 28 Sep 2016 10:02:31 +0200 Subject: Some fixes about upgrade from 2.0.x -> 2.1.0 --- app/DoctrineMigrations/Version20160812120952.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'app/DoctrineMigrations') diff --git a/app/DoctrineMigrations/Version20160812120952.php b/app/DoctrineMigrations/Version20160812120952.php index 9adfdc8b..a8d3bcf2 100644 --- a/app/DoctrineMigrations/Version20160812120952.php +++ b/app/DoctrineMigrations/Version20160812120952.php @@ -29,7 +29,11 @@ class Version20160812120952 extends AbstractMigration implements ContainerAwareI */ public function up(Schema $schema) { - $this->addSql('ALTER TABLE '.$this->getTable('oauth2_clients').' ADD name longtext COLLATE \'utf8_unicode_ci\' DEFAULT NULL'); + if ($this->connection->getDatabasePlatform()->getName() == 'sqlite') { + $this->addSql('ALTER TABLE '.$this->getTable('oauth2_clients').' ADD name longtext DEFAULT NULL'); + } else { + $this->addSql('ALTER TABLE '.$this->getTable('oauth2_clients').' ADD name longtext COLLATE \'utf8_unicode_ci\' DEFAULT NULL'); + } } /** -- cgit v1.2.3 From 4c79c51f998fbec0caba3cf20291a9a54916af09 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Sun, 9 Oct 2016 21:35:04 +0200 Subject: Fix PostgreSQL migrations --- app/DoctrineMigrations/Version20160410190541.php | 13 +++++++++---- app/DoctrineMigrations/Version20160812120952.php | 13 +++++++++---- app/DoctrineMigrations/Version20160911214952.php | 4 ++-- app/DoctrineMigrations/Version20160916201049.php | 8 ++++---- 4 files changed, 24 insertions(+), 14 deletions(-) (limited to 'app/DoctrineMigrations') diff --git a/app/DoctrineMigrations/Version20160410190541.php b/app/DoctrineMigrations/Version20160410190541.php index 4014857b..f034b0e4 100644 --- a/app/DoctrineMigrations/Version20160410190541.php +++ b/app/DoctrineMigrations/Version20160410190541.php @@ -29,8 +29,13 @@ class Version20160410190541 extends AbstractMigration implements ContainerAwareI */ public function up(Schema $schema) { - $this->addSql('ALTER TABLE `'.$this->getTable('entry').'` ADD `uuid` LONGTEXT DEFAULT NULL'); - $this->addSql("INSERT INTO `".$this->getTable('craue_config_setting')."` (`name`, `value`, `section`) VALUES ('share_public', '1', 'entry')"); + if ($this->connection->getDatabasePlatform()->getName() == 'postgresql') { + $this->addSql('ALTER TABLE "'.$this->getTable('entry').'" ADD uuid UUID DEFAULT NULL'); + } else { + $this->addSql('ALTER TABLE "'.$this->getTable('entry').'" ADD uuid LONGTEXT DEFAULT NULL'); + } + + $this->addSql("INSERT INTO \"".$this->getTable('craue_config_setting')."\" (name, value, section) VALUES ('share_public', '1', 'entry')"); } /** @@ -40,7 +45,7 @@ class Version20160410190541 extends AbstractMigration implements ContainerAwareI { $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'sqlite', 'This down migration can\'t be executed on SQLite databases, because SQLite don\'t support DROP COLUMN.'); - $this->addSql('ALTER TABLE `'.$this->getTable('entry').'` DROP `uuid`'); - $this->addSql("DELETE FROM `".$this->getTable('craue_config_setting')."` WHERE `name` = 'share_public'"); + $this->addSql('ALTER TABLE "'.$this->getTable('entry').'" DROP uuid'); + $this->addSql("DELETE FROM \"".$this->getTable('craue_config_setting')."\" WHERE name = 'share_public'"); } } diff --git a/app/DoctrineMigrations/Version20160812120952.php b/app/DoctrineMigrations/Version20160812120952.php index a8d3bcf2..3aafea64 100644 --- a/app/DoctrineMigrations/Version20160812120952.php +++ b/app/DoctrineMigrations/Version20160812120952.php @@ -29,10 +29,15 @@ class Version20160812120952 extends AbstractMigration implements ContainerAwareI */ public function up(Schema $schema) { - if ($this->connection->getDatabasePlatform()->getName() == 'sqlite') { - $this->addSql('ALTER TABLE '.$this->getTable('oauth2_clients').' ADD name longtext DEFAULT NULL'); - } else { - $this->addSql('ALTER TABLE '.$this->getTable('oauth2_clients').' ADD name longtext COLLATE \'utf8_unicode_ci\' DEFAULT NULL'); + switch ($this->connection->getDatabasePlatform()->getName()) { + case 'sqlite': + $this->addSql('ALTER TABLE '.$this->getTable('oauth2_clients').' ADD name longtext DEFAULT NULL'); + break; + case 'mysql': + $this->addSql('ALTER TABLE '.$this->getTable('oauth2_clients').' ADD name longtext COLLATE \'utf8_unicode_ci\' DEFAULT NULL'); + break; + case 'postgresql': + $this->addSql('ALTER TABLE '.$this->getTable('oauth2_clients').' ADD name text DEFAULT NULL'); } } diff --git a/app/DoctrineMigrations/Version20160911214952.php b/app/DoctrineMigrations/Version20160911214952.php index 35809cec..f14f7bc6 100644 --- a/app/DoctrineMigrations/Version20160911214952.php +++ b/app/DoctrineMigrations/Version20160911214952.php @@ -29,8 +29,8 @@ 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\')'); + $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\')'); } /** diff --git a/app/DoctrineMigrations/Version20160916201049.php b/app/DoctrineMigrations/Version20160916201049.php index 202901e6..0d2edf9e 100644 --- a/app/DoctrineMigrations/Version20160916201049.php +++ b/app/DoctrineMigrations/Version20160916201049.php @@ -29,8 +29,8 @@ 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('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';"); } /** @@ -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')"); } } -- cgit v1.2.3