From e3021120e3daa7e152a9c7f8935a2a0a624a03d2 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sun, 21 Aug 2016 09:45:36 +0200 Subject: [PATCH] Checked tables do not exist before creating them --- data/migrations/Version20160820191203.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/data/migrations/Version20160820191203.php b/data/migrations/Version20160820191203.php index 10fb2b08..29e81040 100644 --- a/data/migrations/Version20160820191203.php +++ b/data/migrations/Version20160820191203.php @@ -16,6 +16,14 @@ class Version20160820191203 extends AbstractMigration */ public function up(Schema $schema) { + // Check if the tables already exist + $tables = $schema->getTables(); + foreach ($tables as $table) { + if ($table->getName() === 'tags') { + return; + } + } + $this->createTagsTable($schema); $this->createShortUrlsInTagsTable($schema); }