From a4d55a9161144f7e0daafff8da13dabc9e090ae2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Nicolas=20L=C5=93uillet?= Date: Sat, 26 Nov 2016 13:34:36 +0100 Subject: [PATCH] Replaced abortIf with skipIf --- app/DoctrineMigrations/Version20160812120952.php | 2 +- app/DoctrineMigrations/Version20160911214952.php | 2 +- app/DoctrineMigrations/Version20160916201049.php | 2 +- app/DoctrineMigrations/Version20161001072726.php | 2 +- app/DoctrineMigrations/Version20161022134138.php | 3 +-- app/DoctrineMigrations/Version20161031132655.php | 8 ++++---- app/DoctrineMigrations/Version20161104073720.php | 3 +-- app/DoctrineMigrations/Version20161106113822.php | 2 +- app/DoctrineMigrations/Version20161117071626.php | 10 +++++----- app/DoctrineMigrations/Version20161118134328.php | 2 +- app/DoctrineMigrations/Version20161122144743.php | 8 ++++---- app/DoctrineMigrations/Version20161122203647.php | 2 +- 12 files changed, 22 insertions(+), 24 deletions(-) diff --git a/app/DoctrineMigrations/Version20160812120952.php b/app/DoctrineMigrations/Version20160812120952.php index 3ed1b798..a5d11e3f 100644 --- a/app/DoctrineMigrations/Version20160812120952.php +++ b/app/DoctrineMigrations/Version20160812120952.php @@ -50,7 +50,7 @@ class Version20160812120952 extends AbstractMigration implements ContainerAwareI */ public function down(Schema $schema) { - $this->abortIf($this->connection->getDatabasePlatform()->getName() == 'sqlite', 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.'); + $this->skipIf($this->connection->getDatabasePlatform()->getName() == 'sqlite', 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.'); $this->addSql('ALTER TABLE '.$this->getTable('oauth2_clients').' DROP COLUMN name'); } diff --git a/app/DoctrineMigrations/Version20160911214952.php b/app/DoctrineMigrations/Version20160911214952.php index f14f7bc6..53e5cf85 100644 --- a/app/DoctrineMigrations/Version20160911214952.php +++ b/app/DoctrineMigrations/Version20160911214952.php @@ -21,7 +21,7 @@ class Version20160911214952 extends AbstractMigration implements ContainerAwareI private function getTable($tableName) { - return $this->container->getParameter('database_table_prefix') . $tableName; + return $this->container->getParameter('database_table_prefix').$tableName; } /** diff --git a/app/DoctrineMigrations/Version20160916201049.php b/app/DoctrineMigrations/Version20160916201049.php index 5db00108..83ed6b61 100644 --- a/app/DoctrineMigrations/Version20160916201049.php +++ b/app/DoctrineMigrations/Version20160916201049.php @@ -40,7 +40,7 @@ class Version20160916201049 extends AbstractMigration implements ContainerAwareI */ public function down(Schema $schema) { - $this->abortIf($this->connection->getDatabasePlatform()->getName() == 'sqlite', 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.'); + $this->skipIf($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')"); diff --git a/app/DoctrineMigrations/Version20161001072726.php b/app/DoctrineMigrations/Version20161001072726.php index 237db932..5ab88555 100644 --- a/app/DoctrineMigrations/Version20161001072726.php +++ b/app/DoctrineMigrations/Version20161001072726.php @@ -21,7 +21,7 @@ class Version20161001072726 extends AbstractMigration implements ContainerAwareI private function getTable($tableName) { - return $this->container->getParameter('database_table_prefix') . $tableName; + return $this->container->getParameter('database_table_prefix').$tableName; } /** diff --git a/app/DoctrineMigrations/Version20161022134138.php b/app/DoctrineMigrations/Version20161022134138.php index 5cce55a5..b3d02b40 100644 --- a/app/DoctrineMigrations/Version20161022134138.php +++ b/app/DoctrineMigrations/Version20161022134138.php @@ -21,7 +21,7 @@ class Version20161022134138 extends AbstractMigration implements ContainerAwareI private function getTable($tableName) { - return $this->container->getParameter('database_table_prefix') . $tableName; + return $this->container->getParameter('database_table_prefix').$tableName; } /** @@ -72,6 +72,5 @@ class Version20161022134138 extends AbstractMigration implements ContainerAwareI $this->addSql('ALTER TABLE '.$this->getTable('tag').' CHANGE `label` `label` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci;'); $this->addSql('ALTER TABLE '.$this->getTable('user').' CHANGE `name` `name` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci;'); - } } diff --git a/app/DoctrineMigrations/Version20161031132655.php b/app/DoctrineMigrations/Version20161031132655.php index c7364428..80163c0b 100644 --- a/app/DoctrineMigrations/Version20161031132655.php +++ b/app/DoctrineMigrations/Version20161031132655.php @@ -21,7 +21,7 @@ class Version20161031132655 extends AbstractMigration implements ContainerAwareI private function getTable($tableName) { - return $this->container->getParameter('database_table_prefix') . $tableName; + return $this->container->getParameter('database_table_prefix').$tableName; } /** @@ -29,7 +29,7 @@ class Version20161031132655 extends AbstractMigration implements ContainerAwareI */ public function up(Schema $schema) { - $this->addSql("INSERT INTO \"".$this->getTable('craue_config_setting')."\" (name, value, section) VALUES ('download_images_enabled', 0, 'misc')"); + $this->addSql('INSERT INTO "'.$this->getTable('craue_config_setting')."\" (name, value, section) VALUES ('download_images_enabled', 0, 'misc')"); } /** @@ -37,8 +37,8 @@ class Version20161031132655 extends AbstractMigration implements ContainerAwareI */ public function down(Schema $schema) { - $this->abortIf($this->connection->getDatabasePlatform()->getName() == 'sqlite', 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.'); + $this->skipIf($this->connection->getDatabasePlatform()->getName() == 'sqlite', 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.'); - $this->addSql("DELETE FROM \"".$this->getTable('craue_config_setting')."\" WHERE name = 'download_images_enabled';"); + $this->addSql('DELETE FROM "'.$this->getTable('craue_config_setting')."\" WHERE name = 'download_images_enabled';"); } } diff --git a/app/DoctrineMigrations/Version20161104073720.php b/app/DoctrineMigrations/Version20161104073720.php index 16503b4b..7a0361f8 100644 --- a/app/DoctrineMigrations/Version20161104073720.php +++ b/app/DoctrineMigrations/Version20161104073720.php @@ -21,7 +21,7 @@ class Version20161104073720 extends AbstractMigration implements ContainerAwareI private function getTable($tableName) { - return $this->container->getParameter('database_table_prefix') . $tableName; + return $this->container->getParameter('database_table_prefix').$tableName; } /** @@ -48,6 +48,5 @@ class Version20161104073720 extends AbstractMigration implements ContainerAwareI */ public function down(Schema $schema) { - } } diff --git a/app/DoctrineMigrations/Version20161106113822.php b/app/DoctrineMigrations/Version20161106113822.php index a5401b2c..5e3fd562 100644 --- a/app/DoctrineMigrations/Version20161106113822.php +++ b/app/DoctrineMigrations/Version20161106113822.php @@ -39,7 +39,7 @@ class Version20161106113822 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->skipIf($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('config').' DROP action_mark_as_read'); } diff --git a/app/DoctrineMigrations/Version20161117071626.php b/app/DoctrineMigrations/Version20161117071626.php index 9ae55b5f..33f5707e 100644 --- a/app/DoctrineMigrations/Version20161117071626.php +++ b/app/DoctrineMigrations/Version20161117071626.php @@ -21,7 +21,7 @@ class Version20161117071626 extends AbstractMigration implements ContainerAwareI private function getTable($tableName) { - return $this->container->getParameter('database_table_prefix') . $tableName; + return $this->container->getParameter('database_table_prefix').$tableName; } /** @@ -29,8 +29,8 @@ 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')"); + $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')"); } /** @@ -38,7 +38,7 @@ class Version20161117071626 extends AbstractMigration implements ContainerAwareI */ public function down(Schema $schema) { - $this->addSql("DELETE FROM ".$this->getTable('craue_config_setting')." WHERE name = 'share_unmark';"); - $this->addSql("DELETE FROM ".$this->getTable('craue_config_setting')." WHERE name = 'unmark_url';"); + $this->addSql('DELETE FROM '.$this->getTable('craue_config_setting')." WHERE name = 'share_unmark';"); + $this->addSql('DELETE FROM '.$this->getTable('craue_config_setting')." WHERE name = 'unmark_url';"); } } diff --git a/app/DoctrineMigrations/Version20161118134328.php b/app/DoctrineMigrations/Version20161118134328.php index 76dd9074..69eae5a5 100644 --- a/app/DoctrineMigrations/Version20161118134328.php +++ b/app/DoctrineMigrations/Version20161118134328.php @@ -42,7 +42,7 @@ class Version20161118134328 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->skipIf($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 http_status'); } diff --git a/app/DoctrineMigrations/Version20161122144743.php b/app/DoctrineMigrations/Version20161122144743.php index ec80c48e..536b8339 100644 --- a/app/DoctrineMigrations/Version20161122144743.php +++ b/app/DoctrineMigrations/Version20161122144743.php @@ -8,7 +8,7 @@ use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** - * Add the restricted_access internal setting for articles with paywall + * Add the restricted_access internal setting for articles with paywall. */ class Version20161122144743 extends AbstractMigration implements ContainerAwareInterface { @@ -24,7 +24,7 @@ class Version20161122144743 extends AbstractMigration implements ContainerAwareI private function getTable($tableName) { - return $this->container->getParameter('database_table_prefix') . $tableName; + return $this->container->getParameter('database_table_prefix').$tableName; } /** @@ -32,7 +32,7 @@ class Version20161122144743 extends AbstractMigration implements ContainerAwareI */ public function up(Schema $schema) { - $this->addSql("INSERT INTO ".$this->getTable('craue_config_setting')." (name, value, section) VALUES ('restricted_access', 0, 'entry')"); + $this->addSql('INSERT INTO '.$this->getTable('craue_config_setting')." (name, value, section) VALUES ('restricted_access', 0, 'entry')"); } /** @@ -40,6 +40,6 @@ class Version20161122144743 extends AbstractMigration implements ContainerAwareI */ public function down(Schema $schema) { - $this->addSql("DELETE FROM ".$this->getTable('craue_config_setting')." WHERE name = 'restricted_access';"); + $this->addSql('DELETE FROM '.$this->getTable('craue_config_setting')." WHERE name = 'restricted_access';"); } } diff --git a/app/DoctrineMigrations/Version20161122203647.php b/app/DoctrineMigrations/Version20161122203647.php index 2cb990e1..354a10e8 100644 --- a/app/DoctrineMigrations/Version20161122203647.php +++ b/app/DoctrineMigrations/Version20161122203647.php @@ -40,7 +40,7 @@ class Version20161122203647 extends AbstractMigration implements ContainerAwareI */ public function up(Schema $schema) { - $this->abortIf($this->connection->getDatabasePlatform()->getName() === 'sqlite', 'This up migration can\'t be executed on SQLite databases, because SQLite don\'t support DROP COLUMN.'); + $this->skipIf($this->connection->getDatabasePlatform()->getName() === 'sqlite', 'This up migration can\'t be executed on SQLite databases, because SQLite don\'t support DROP COLUMN.'); $this->skipIf(false === $schema->getTable($this->getTable('user'))->hasColumn('expired'), 'It seems that you already played this migration.'); -- 2.41.0