diff --git a/CHANGELOG.md b/CHANGELOG.md index 475f9be1..0fefbcb1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,23 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com), and this project adheres to [Semantic Versioning](https://semver.org). +## [Unreleased] +### Added +* *Nothing* + +### Changed +* *Nothing* + +### Deprecated +* *Nothing* + +### Removed +* *Nothing* + +### Fixed +* [#1024](https://github.com/shlinkio/shlink/issues/1024) Fixed migration that is incorrectly skipped due to the wrong condition being used to check it. + + ## [2.6.0] - 2021-02-13 ### Added * [#856](https://github.com/shlinkio/shlink/issues/856) Added PHP 8.0 support. diff --git a/data/migrations/Version20210207100807.php b/data/migrations/Version20210207100807.php index a74c0b08..24e73d34 100644 --- a/data/migrations/Version20210207100807.php +++ b/data/migrations/Version20210207100807.php @@ -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');