aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJeremy Benoist <jeremy.benoist@gmail.com>2017-12-12 13:41:44 +0100
committerJeremy Benoist <jeremy.benoist@gmail.com>2017-12-12 13:41:44 +0100
commitad46f2fb46bf97d520a82ec5c15266e3c48c4e0b (patch)
tree106017635ea2f6f4a8a1fdc069225dc5a1523c91
parent43e1711eb66a55e954bcffa2f37fd30c1b3b1fae (diff)
downloadwallabag-ad46f2fb46bf97d520a82ec5c15266e3c48c4e0b.tar.gz
wallabag-ad46f2fb46bf97d520a82ec5c15266e3c48c4e0b.tar.zst
wallabag-ad46f2fb46bf97d520a82ec5c15266e3c48c4e0b.zip
Use hasTable instead of try/catch
-rw-r--r--app/DoctrineMigrations/Version20160401000000.php8
1 files changed, 1 insertions, 7 deletions
diff --git a/app/DoctrineMigrations/Version20160401000000.php b/app/DoctrineMigrations/Version20160401000000.php
index 54bfb0f0..9916321f 100644
--- a/app/DoctrineMigrations/Version20160401000000.php
+++ b/app/DoctrineMigrations/Version20160401000000.php
@@ -28,13 +28,7 @@ class Version20160401000000 extends AbstractMigration implements ContainerAwareI
28 */ 28 */
29 public function up(Schema $schema) 29 public function up(Schema $schema)
30 { 30 {
31 try { 31 $this->skipIf($schema->hasTable($this->getTable('entry')), 'Database already initialized');
32 $schema->getTable($this->getTable('entry'));
33
34 $this->skipIf(true, 'Database already initialized');
35 } catch (SchemaException $e) {
36 // it's ok, the table does not exist we can proceed to the initial migration
37 }
38 32
39 switch ($this->connection->getDatabasePlatform()->getName()) { 33 switch ($this->connection->getDatabasePlatform()->getName()) {
40 case 'sqlite': 34 case 'sqlite':