From 6f6388b2fc596aa38be0e46c92313219492329a5 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Mon, 25 Nov 2024 09:23:43 +0100 Subject: [PATCH 1/4] Go back to using akrabat/ip-address-middleware instead of acelaya/ip-address-middleware --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 6656c8ea..7167c071 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,7 @@ "ext-mbstring": "*", "ext-pdo": "*", "acelaya/crawler-detect": "^1.3", - "acelaya/ip-address-middleware": "^2.4", + "akrabat/ip-address-middleware": "^2.4", "cakephp/chronos": "^3.1", "doctrine/dbal": "^4.2", "doctrine/migrations": "^3.8", From 35b835ec7b70eccd4e9dc05dfa57c0207996f15e Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Mon, 25 Nov 2024 22:17:15 +0100 Subject: [PATCH 2/4] Use jaybizzle/crawler-detect instead of acelaya/crawler-detect --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 7167c071..68f38f18 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,6 @@ "ext-json": "*", "ext-mbstring": "*", "ext-pdo": "*", - "acelaya/crawler-detect": "^1.3", "akrabat/ip-address-middleware": "^2.4", "cakephp/chronos": "^3.1", "doctrine/dbal": "^4.2", @@ -29,6 +28,7 @@ "geoip2/geoip2": "^3.0", "guzzlehttp/guzzle": "^7.9", "hidehalo/nanoid-php": "^2.0", + "jaybizzle/crawler-detect": "^1.3", "laminas/laminas-config-aggregator": "^1.15", "laminas/laminas-diactoros": "^3.5", "laminas/laminas-inputfilter": "^2.30", From 33cea36b15c08c77ff00752bd18d821f285b0c63 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Mon, 25 Nov 2024 22:48:04 +0100 Subject: [PATCH 3/4] Fix columns order in unique_short_code_plus_domain index in MSSQL --- CHANGELOG.md | 17 +++++++++++ .../Core/migrations/Version20241125213106.php | 28 +++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 module/Core/migrations/Version20241125213106.php diff --git a/CHANGELOG.md b/CHANGELOG.md index be405837..5ef09752 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 +* [#2285](https://github.com/shlinkio/shlink/issues/2285) Fix performance degradation when using Microsoft SQL due to incorrect order of columns in `unique_short_code_plus_domain` index. + + ## [4.3.0] - 2024-11-24 ### Added * [#2159](https://github.com/shlinkio/shlink/issues/2159) Add support for PHP 8.4. diff --git a/module/Core/migrations/Version20241125213106.php b/module/Core/migrations/Version20241125213106.php new file mode 100644 index 00000000..a51f143b --- /dev/null +++ b/module/Core/migrations/Version20241125213106.php @@ -0,0 +1,28 @@ +skipIf(! $this->isMsSql()); + + // Recreate unique_short_code_plus_domain index in Microsoft SQL, as it accidentally has the columns defined in + // the wrong order after Version20230130090946 migration + $shortUrls = $schema->getTable('short_urls'); + $shortUrls->dropIndex('unique_short_code_plus_domain'); + $shortUrls->addUniqueIndex(['short_code', 'domain_id'], 'unique_short_code_plus_domain'); + } + + private function isMsSql(): bool + { + return $this->connection->getDatabasePlatform() instanceof SQLServerPlatform; + } +} From 557c74286b724b95e23b83f8c6dd5861ada50052 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Mon, 25 Nov 2024 23:45:02 +0100 Subject: [PATCH 4/4] Add v4.3.1 to changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ef09752..d8ac53d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ 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] +# [4.3.1] - 2024-11-25 ### Added * *Nothing*