From 0f2bd77ebc45566c6922d9d449b3b8e98968adeb Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Fri, 12 Mar 2021 08:54:23 +0100 Subject: [PATCH 1/4] Fixed dependencies pinned to older versions --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index a22c26ae..baa9f5cb 100644 --- a/composer.json +++ b/composer.json @@ -21,10 +21,10 @@ "doctrine/cache": "^1.9", "doctrine/migrations": "^3.0.2", "doctrine/orm": "2.8.1 || ^2.8.3", - "endroid/qr-code": "dev-master#0f1613a as 3.10", + "endroid/qr-code": "3.x-dev#0f1613a as 3.10", "geoip2/geoip2": "^2.9", "guzzlehttp/guzzle": "^7.0", - "happyr/doctrine-specification": "2.0.x-dev#cb116d3 as 2.0", + "happyr/doctrine-specification": "2.x-dev#cb116d3 as 2.0", "laminas/laminas-config": "^3.3", "laminas/laminas-config-aggregator": "^1.1", "laminas/laminas-diactoros": "^2.1.3", From a0062a62e89f5a722ddc7b575b778a9356dc5ea2 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Fri, 12 Mar 2021 11:52:43 +0100 Subject: [PATCH 2/4] Ensured all migrations are non-transactional, which allows woring around an issue in doctrine-migrations --- composer.json | 2 +- data/migrations/Version20160819142757.php | 14 +++++++++++--- data/migrations/Version20160820191203.php | 8 ++++++++ data/migrations/Version20171021093246.php | 8 ++++++++ data/migrations/Version20171022064541.php | 8 ++++++++ data/migrations/Version20180801183328.php | 8 ++++++++ data/migrations/Version20180913205455.php | 16 ++++++++++------ data/migrations/Version20180915110857.php | 8 ++++++++ data/migrations/Version20181020060559.php | 12 ++++++++++-- data/migrations/Version20181020065148.php | 8 ++++++++ data/migrations/Version20181110175521.php | 8 ++++++++ data/migrations/Version20190824075137.php | 8 ++++++++ data/migrations/Version20190930165521.php | 8 ++++++++ data/migrations/Version20191001201532.php | 8 ++++++++ data/migrations/Version20191020074522.php | 8 ++++++++ data/migrations/Version20200105165647.php | 18 +++++++++++++----- data/migrations/Version20200106215144.php | 14 +++++++++++--- data/migrations/Version20200110182849.php | 8 ++++++++ data/migrations/Version20200323190014.php | 8 ++++++++ data/migrations/Version20200503170404.php | 8 ++++++++ data/migrations/Version20201023090929.php | 8 ++++++++ data/migrations/Version20201102113208.php | 8 ++++++++ data/migrations/Version20210102174433.php | 8 ++++++++ data/migrations/Version20210118153932.php | 8 ++++++++ 24 files changed, 200 insertions(+), 20 deletions(-) diff --git a/composer.json b/composer.json index baa9f5cb..c2c8dc45 100644 --- a/composer.json +++ b/composer.json @@ -70,7 +70,7 @@ "phpunit/phpunit": "^9.5", "roave/security-advisories": "dev-master", "shlinkio/php-coding-standard": "~2.1.1", - "shlinkio/shlink-test-utils": "^2.0", + "shlinkio/shlink-test-utils": "^2.1", "symfony/var-dumper": "^5.2", "veewee/composer-run-parallel": "^0.1.0" }, diff --git a/data/migrations/Version20160819142757.php b/data/migrations/Version20160819142757.php index 482a8e7a..966a53a0 100644 --- a/data/migrations/Version20160819142757.php +++ b/data/migrations/Version20160819142757.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace ShlinkMigrations; -use Doctrine\DBAL\DBALException; +use Doctrine\DBAL\Exception; use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\SchemaException; use Doctrine\Migrations\AbstractMigration; @@ -18,7 +18,7 @@ class Version20160819142757 extends AbstractMigration private const SQLITE = 'sqlite'; /** - * @throws DBALException + * @throws Exception * @throws SchemaException */ public function up(Schema $schema): void @@ -35,10 +35,18 @@ class Version20160819142757 extends AbstractMigration } /** - * @throws DBALException + * @throws Exception */ public function down(Schema $schema): void { $db = $this->connection->getDatabasePlatform()->getName(); } + + /** + * @fixme Workaround for https://github.com/doctrine/migrations/issues/1104 + */ + public function isTransactional(): bool + { + return false; + } } diff --git a/data/migrations/Version20160820191203.php b/data/migrations/Version20160820191203.php index d0a4d673..ae2b7bcf 100644 --- a/data/migrations/Version20160820191203.php +++ b/data/migrations/Version20160820191203.php @@ -73,4 +73,12 @@ class Version20160820191203 extends AbstractMigration $schema->dropTable('short_urls_in_tags'); $schema->dropTable('tags'); } + + /** + * @fixme Workaround for https://github.com/doctrine/migrations/issues/1104 + */ + public function isTransactional(): bool + { + return false; + } } diff --git a/data/migrations/Version20171021093246.php b/data/migrations/Version20171021093246.php index 83f08e41..54dd54cc 100644 --- a/data/migrations/Version20171021093246.php +++ b/data/migrations/Version20171021093246.php @@ -45,4 +45,12 @@ class Version20171021093246 extends AbstractMigration $shortUrls->dropColumn('valid_since'); $shortUrls->dropColumn('valid_until'); } + + /** + * @fixme Workaround for https://github.com/doctrine/migrations/issues/1104 + */ + public function isTransactional(): bool + { + return false; + } } diff --git a/data/migrations/Version20171022064541.php b/data/migrations/Version20171022064541.php index 7ff39666..86efc008 100644 --- a/data/migrations/Version20171022064541.php +++ b/data/migrations/Version20171022064541.php @@ -42,4 +42,12 @@ class Version20171022064541 extends AbstractMigration $shortUrls->dropColumn('max_visits'); } + + /** + * @fixme Workaround for https://github.com/doctrine/migrations/issues/1104 + */ + public function isTransactional(): bool + { + return false; + } } diff --git a/data/migrations/Version20180801183328.php b/data/migrations/Version20180801183328.php index 24bcd825..232b37b0 100644 --- a/data/migrations/Version20180801183328.php +++ b/data/migrations/Version20180801183328.php @@ -39,4 +39,12 @@ final class Version20180801183328 extends AbstractMigration { $schema->getTable('short_urls')->getColumn('short_code')->setLength($size); } + + /** + * @fixme Workaround for https://github.com/doctrine/migrations/issues/1104 + */ + public function isTransactional(): bool + { + return false; + } } diff --git a/data/migrations/Version20180913205455.php b/data/migrations/Version20180913205455.php index c2bc2070..187b860e 100644 --- a/data/migrations/Version20180913205455.php +++ b/data/migrations/Version20180913205455.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace ShlinkMigrations; -use Doctrine\DBAL\DBALException; +use Doctrine\DBAL\Exception; use Doctrine\DBAL\Schema\Schema; use Doctrine\Migrations\AbstractMigration; use PDO; @@ -16,15 +16,13 @@ use Shlinkio\Shlink\Common\Util\IpAddress; */ final class Version20180913205455 extends AbstractMigration { - /** - */ public function up(Schema $schema): void { // Nothing to create } /** - * @throws DBALException + * @throws Exception */ public function postUp(Schema $schema): void { @@ -64,10 +62,16 @@ final class Version20180913205455 extends AbstractMigration } } - /** - */ public function down(Schema $schema): void { // Nothing to rollback } + + /** + * @fixme Workaround for https://github.com/doctrine/migrations/issues/1104 + */ + public function isTransactional(): bool + { + return false; + } } diff --git a/data/migrations/Version20180915110857.php b/data/migrations/Version20180915110857.php index 73a36597..51a1ed72 100644 --- a/data/migrations/Version20180915110857.php +++ b/data/migrations/Version20180915110857.php @@ -47,4 +47,12 @@ final class Version20180915110857 extends AbstractMigration { // Nothing to run } + + /** + * @fixme Workaround for https://github.com/doctrine/migrations/issues/1104 + */ + public function isTransactional(): bool + { + return false; + } } diff --git a/data/migrations/Version20181020060559.php b/data/migrations/Version20181020060559.php index 5b46b6df..804027d2 100644 --- a/data/migrations/Version20181020060559.php +++ b/data/migrations/Version20181020060559.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace ShlinkMigrations; -use Doctrine\DBAL\DBALException; +use Doctrine\DBAL\Exception; use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\SchemaException; use Doctrine\DBAL\Schema\Table; @@ -42,7 +42,7 @@ final class Version20181020060559 extends AbstractMigration /** * @throws SchemaException - * @throws DBALException + * @throws Exception */ public function postUp(Schema $schema): void { @@ -65,4 +65,12 @@ final class Version20181020060559 extends AbstractMigration { // No down } + + /** + * @fixme Workaround for https://github.com/doctrine/migrations/issues/1104 + */ + public function isTransactional(): bool + { + return false; + } } diff --git a/data/migrations/Version20181020065148.php b/data/migrations/Version20181020065148.php index 62b14ccf..4e33f8e9 100644 --- a/data/migrations/Version20181020065148.php +++ b/data/migrations/Version20181020065148.php @@ -38,4 +38,12 @@ final class Version20181020065148 extends AbstractMigration { // No down } + + /** + * @fixme Workaround for https://github.com/doctrine/migrations/issues/1104 + */ + public function isTransactional(): bool + { + return false; + } } diff --git a/data/migrations/Version20181110175521.php b/data/migrations/Version20181110175521.php index aae8d419..7142522a 100644 --- a/data/migrations/Version20181110175521.php +++ b/data/migrations/Version20181110175521.php @@ -34,4 +34,12 @@ final class Version20181110175521 extends AbstractMigration { return $schema->getTable('visits')->getColumn('user_agent'); } + + /** + * @fixme Workaround for https://github.com/doctrine/migrations/issues/1104 + */ + public function isTransactional(): bool + { + return false; + } } diff --git a/data/migrations/Version20190824075137.php b/data/migrations/Version20190824075137.php index 208d85a3..893ea4f5 100644 --- a/data/migrations/Version20190824075137.php +++ b/data/migrations/Version20190824075137.php @@ -34,4 +34,12 @@ final class Version20190824075137 extends AbstractMigration { return $schema->getTable('visits')->getColumn('referer'); } + + /** + * @fixme Workaround for https://github.com/doctrine/migrations/issues/1104 + */ + public function isTransactional(): bool + { + return false; + } } diff --git a/data/migrations/Version20190930165521.php b/data/migrations/Version20190930165521.php index 2e4e8f50..de11c3b5 100644 --- a/data/migrations/Version20190930165521.php +++ b/data/migrations/Version20190930165521.php @@ -52,4 +52,12 @@ final class Version20190930165521 extends AbstractMigration $schema->getTable('short_urls')->dropColumn('domain_id'); $schema->dropTable('domains'); } + + /** + * @fixme Workaround for https://github.com/doctrine/migrations/issues/1104 + */ + public function isTransactional(): bool + { + return false; + } } diff --git a/data/migrations/Version20191001201532.php b/data/migrations/Version20191001201532.php index d067101c..045c65cc 100644 --- a/data/migrations/Version20191001201532.php +++ b/data/migrations/Version20191001201532.php @@ -46,4 +46,12 @@ final class Version20191001201532 extends AbstractMigration $shortUrls->dropIndex('unique_short_code_plus_domain'); $shortUrls->addUniqueIndex(['short_code']); } + + /** + * @fixme Workaround for https://github.com/doctrine/migrations/issues/1104 + */ + public function isTransactional(): bool + { + return false; + } } diff --git a/data/migrations/Version20191020074522.php b/data/migrations/Version20191020074522.php index baf1ce7a..638f60db 100644 --- a/data/migrations/Version20191020074522.php +++ b/data/migrations/Version20191020074522.php @@ -34,4 +34,12 @@ final class Version20191020074522 extends AbstractMigration { return $schema->getTable('short_urls')->getColumn('original_url'); } + + /** + * @fixme Workaround for https://github.com/doctrine/migrations/issues/1104 + */ + public function isTransactional(): bool + { + return false; + } } diff --git a/data/migrations/Version20200105165647.php b/data/migrations/Version20200105165647.php index 6367f440..3672322c 100644 --- a/data/migrations/Version20200105165647.php +++ b/data/migrations/Version20200105165647.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace ShlinkMigrations; -use Doctrine\DBAL\DBALException; +use Doctrine\DBAL\Exception; use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Types\Types; use Doctrine\Migrations\AbstractMigration; @@ -16,7 +16,7 @@ final class Version20200105165647 extends AbstractMigration private const COLUMNS = ['lat' => 'latitude', 'lon' => 'longitude']; /** - * @throws DBALException + * @throws Exception */ public function preUp(Schema $schema): void { @@ -43,7 +43,7 @@ final class Version20200105165647 extends AbstractMigration } /** - * @throws DBALException + * @throws Exception */ public function up(Schema $schema): void { @@ -57,7 +57,7 @@ final class Version20200105165647 extends AbstractMigration } /** - * @throws DBALException + * @throws Exception */ public function postUp(Schema $schema): void { @@ -83,7 +83,7 @@ final class Version20200105165647 extends AbstractMigration } /** - * @throws DBALException + * @throws Exception */ public function down(Schema $schema): void { @@ -93,4 +93,12 @@ final class Version20200105165647 extends AbstractMigration $visitLocations->dropColumn($colName); } } + + /** + * @fixme Workaround for https://github.com/doctrine/migrations/issues/1104 + */ + public function isTransactional(): bool + { + return false; + } } diff --git a/data/migrations/Version20200106215144.php b/data/migrations/Version20200106215144.php index e7a2c31a..6ed83522 100644 --- a/data/migrations/Version20200106215144.php +++ b/data/migrations/Version20200106215144.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace ShlinkMigrations; -use Doctrine\DBAL\DBALException; +use Doctrine\DBAL\Exception; use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Types\Types; use Doctrine\Migrations\AbstractMigration; @@ -16,7 +16,7 @@ final class Version20200106215144 extends AbstractMigration private const COLUMNS = ['latitude', 'longitude']; /** - * @throws DBALException + * @throws Exception */ public function up(Schema $schema): void { @@ -32,7 +32,7 @@ final class Version20200106215144 extends AbstractMigration } /** - * @throws DBALException + * @throws Exception */ public function down(Schema $schema): void { @@ -44,4 +44,12 @@ final class Version20200106215144 extends AbstractMigration ]); } } + + /** + * @fixme Workaround for https://github.com/doctrine/migrations/issues/1104 + */ + public function isTransactional(): bool + { + return false; + } } diff --git a/data/migrations/Version20200110182849.php b/data/migrations/Version20200110182849.php index 16b858f9..2d8e18c8 100644 --- a/data/migrations/Version20200110182849.php +++ b/data/migrations/Version20200110182849.php @@ -50,4 +50,12 @@ final class Version20200110182849 extends AbstractMigration { // No need (and no way) to undo this migration } + + /** + * @fixme Workaround for https://github.com/doctrine/migrations/issues/1104 + */ + public function isTransactional(): bool + { + return false; + } } diff --git a/data/migrations/Version20200323190014.php b/data/migrations/Version20200323190014.php index 47cf402a..7adb31b3 100644 --- a/data/migrations/Version20200323190014.php +++ b/data/migrations/Version20200323190014.php @@ -42,4 +42,12 @@ final class Version20200323190014 extends AbstractMigration $visitLocations->dropColumn('is_empty'); } + + /** + * @fixme Workaround for https://github.com/doctrine/migrations/issues/1104 + */ + public function isTransactional(): bool + { + return false; + } } diff --git a/data/migrations/Version20200503170404.php b/data/migrations/Version20200503170404.php index a102c2c8..4779b93b 100644 --- a/data/migrations/Version20200503170404.php +++ b/data/migrations/Version20200503170404.php @@ -24,4 +24,12 @@ final class Version20200503170404 extends AbstractMigration $this->skipIf(! $visits->hasIndex(self::INDEX_NAME)); $visits->dropIndex(self::INDEX_NAME); } + + /** + * @fixme Workaround for https://github.com/doctrine/migrations/issues/1104 + */ + public function isTransactional(): bool + { + return false; + } } diff --git a/data/migrations/Version20201023090929.php b/data/migrations/Version20201023090929.php index 05d16c22..8c1e8622 100644 --- a/data/migrations/Version20201023090929.php +++ b/data/migrations/Version20201023090929.php @@ -41,4 +41,12 @@ final class Version20201023090929 extends AbstractMigration $shortUrls->dropColumn('import_original_short_code'); $shortUrls->dropIndex('unique_imports'); } + + /** + * @fixme Workaround for https://github.com/doctrine/migrations/issues/1104 + */ + public function isTransactional(): bool + { + return false; + } } diff --git a/data/migrations/Version20201102113208.php b/data/migrations/Version20201102113208.php index 1e1237a4..88be074c 100644 --- a/data/migrations/Version20201102113208.php +++ b/data/migrations/Version20201102113208.php @@ -86,4 +86,12 @@ final class Version20201102113208 extends AbstractMigration $shortUrls->removeForeignKey('FK_' . self::API_KEY_COLUMN); $shortUrls->dropColumn(self::API_KEY_COLUMN); } + + /** + * @fixme Workaround for https://github.com/doctrine/migrations/issues/1104 + */ + public function isTransactional(): bool + { + return false; + } } diff --git a/data/migrations/Version20210102174433.php b/data/migrations/Version20210102174433.php index 835fcbda..01616ffe 100644 --- a/data/migrations/Version20210102174433.php +++ b/data/migrations/Version20210102174433.php @@ -49,4 +49,12 @@ final class Version20210102174433 extends AbstractMigration $schema->getTable(self::TABLE_NAME)->dropIndex('UQ_role_plus_api_key'); $schema->dropTable(self::TABLE_NAME); } + + /** + * @fixme Workaround for https://github.com/doctrine/migrations/issues/1104 + */ + public function isTransactional(): bool + { + return false; + } } diff --git a/data/migrations/Version20210118153932.php b/data/migrations/Version20210118153932.php index e17ff533..e9f29759 100644 --- a/data/migrations/Version20210118153932.php +++ b/data/migrations/Version20210118153932.php @@ -23,4 +23,12 @@ final class Version20210118153932 extends AbstractMigration public function down(Schema $schema): void { } + + /** + * @fixme Workaround for https://github.com/doctrine/migrations/issues/1104 + */ + public function isTransactional(): bool + { + return false; + } } From 3ba9ee7bf11733ef59a3bf69d7558bb497efdce3 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Fri, 12 Mar 2021 11:56:41 +0100 Subject: [PATCH 3/4] Updated changelog --- CHANGELOG.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2913aae2..34b17b9f 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). +## [2.6.2] - 2021-03-12 +### Added +* *Nothing* + +### Changed +* *Nothing* + +### Deprecated +* *Nothing* + +### Removed +* *Nothing* + +### Fixed +* [#1047](https://github.com/shlinkio/shlink/issues/1047) Fixed error in migrations when doing a fresh install using PHP8 and MySQL/Mariadb databases. + + ## [2.6.1] - 2021-02-22 ### Added * *Nothing* From be35349350bda87d819bedf8f9e31adff7073415 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Fri, 12 Mar 2021 16:22:53 +0100 Subject: [PATCH 4/4] Fixed typo --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 34b17b9f..5bb7d5f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,7 +18,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com), and this * *Nothing* ### Fixed -* [#1047](https://github.com/shlinkio/shlink/issues/1047) Fixed error in migrations when doing a fresh install using PHP8 and MySQL/Mariadb databases. +* [#1047](https://github.com/shlinkio/shlink/issues/1047) Fixed error in migrations when doing a fresh installation using PHP8 and MySQL/Mariadb databases. ## [2.6.1] - 2021-02-22