]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Use hasTable instead of try/catch
authorJeremy Benoist <jeremy.benoist@gmail.com>
Tue, 12 Dec 2017 12:41:44 +0000 (13:41 +0100)
committerJeremy Benoist <jeremy.benoist@gmail.com>
Tue, 12 Dec 2017 12:41:44 +0000 (13:41 +0100)
app/DoctrineMigrations/Version20160401000000.php

index 54bfb0f033390db0ccd47874009094c7f1372095..9916321fb799298a5de42b4a9545c85da2ea7edc 100644 (file)
@@ -28,13 +28,7 @@ class Version20160401000000 extends AbstractMigration implements ContainerAwareI
      */
     public function up(Schema $schema)
     {
-        try {
-            $schema->getTable($this->getTable('entry'));
-
-            $this->skipIf(true, 'Database already initialized');
-        } catch (SchemaException $e) {
-            // it's ok, the table does not exist we can proceed to the initial migration
-        }
+        $this->skipIf($schema->hasTable($this->getTable('entry')), 'Database already initialized');
 
         switch ($this->connection->getDatabasePlatform()->getName()) {
             case 'sqlite':