mirror of
https://github.com/shlinkio/shlink.git
synced 2024-11-27 16:26:37 +03:00
Fixed migration that could be incorrectly skipped due to wrong condition being used
This commit is contained in:
parent
9247cd874e
commit
32fdb257a3
1 changed files with 4 additions and 6 deletions
|
@ -15,10 +15,9 @@ final class Version20210207100807 extends AbstractMigration
|
|||
public function up(Schema $schema): void
|
||||
{
|
||||
$visits = $schema->getTable('visits');
|
||||
$this->skipIf($visits->hasColumn('visited_url'));
|
||||
|
||||
$shortUrlId = $visits->getColumn('short_url_id');
|
||||
|
||||
$this->skipIf(! $shortUrlId->getNotnull());
|
||||
|
||||
$shortUrlId->setNotnull(false);
|
||||
|
||||
$visits->addColumn('visited_url', Types::STRING, [
|
||||
|
@ -34,10 +33,9 @@ final class Version20210207100807 extends AbstractMigration
|
|||
public function down(Schema $schema): void
|
||||
{
|
||||
$visits = $schema->getTable('visits');
|
||||
$this->skipIf(! $visits->hasColumn('visited_url'));
|
||||
|
||||
$shortUrlId = $visits->getColumn('short_url_id');
|
||||
|
||||
$this->skipIf($shortUrlId->getNotnull());
|
||||
|
||||
$shortUrlId->setNotnull(true);
|
||||
$visits->dropColumn('visited_url');
|
||||
$visits->dropColumn('type');
|
||||
|
|
Loading…
Reference in a new issue