mirror of
https://github.com/shlinkio/shlink.git
synced 2025-03-14 04:00:57 +03:00
Checked tables do not exist before creating them
This commit is contained in:
parent
2ca7ab4ccf
commit
e3021120e3
1 changed files with 8 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue