Checked tables do not exist before creating them

This commit is contained in:
Alejandro Celaya 2016-08-21 09:45:36 +02:00
parent 2ca7ab4ccf
commit e3021120e3

View File

@ -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);
}