mirror of
https://github.com/shlinkio/shlink.git
synced 2025-02-25 18:45:27 -06:00
Checked tables do not exist before creating them
This commit is contained in:
@@ -16,6 +16,14 @@ class Version20160820191203 extends AbstractMigration
|
|||||||
*/
|
*/
|
||||||
public function up(Schema $schema)
|
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->createTagsTable($schema);
|
||||||
$this->createShortUrlsInTagsTable($schema);
|
$this->createShortUrlsInTagsTable($schema);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user