From 16ec23234ef332bc3ea02c8ac96e3d6d192b7781 Mon Sep 17 00:00:00 2001 From: Attila Fulop <1162360+fulopattila122@users.noreply.github.com> Date: Wed, 28 Feb 2024 09:24:54 +0200 Subject: [PATCH] Removed the Doctrine-based migration-workaround --- .github/workflows/tests.yml | 6 +++++- Changelog.md | 1 + ...08_10_175251_streamline_provinces_table.php | 18 ------------------ 3 files changed, 6 insertions(+), 19 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 13ebd12..27be50b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -9,7 +9,7 @@ jobs: strategy: matrix: php: ['8.1', '8.2', '8.3'] - laravel: ['10.0', '10.39', '11.x'] + laravel: ['10.0', '10.46', '11.x'] exclude: - php: '8.1' laravel: '11.x' @@ -26,6 +26,10 @@ jobs: - name: Lock Package Versions run: | composer require "laravel/framework:${{ matrix.laravel }}.*" --no-update -v + - name: Prevent Laravel 10 + Doctrine 4 + run: | + is_smaller_version() [[ $(echo -e "$1\n$2"|sort -V|head -1) != $2 ]] + is_smaller_version "${{ matrix.laravel }}" "10.39" && composer req "doctrine/dbal:^3.5.1" --no-update || true - name: Composer Install run: composer install --prefer-dist --no-progress --no-interaction - name: Create SQLite Database diff --git a/Changelog.md b/Changelog.md index 2118e68..81c54cc 100644 --- a/Changelog.md +++ b/Changelog.md @@ -9,6 +9,7 @@ - Added PHP 8.3 support - Added Laravel 11 support - Added Doctrine DBAL v4 support (required for Laravel 11) +- Removed the Doctrine based migration-workaround for modifying table with enum column that wasn't necessary after Laravel 6 - Changed minimum Enum version to v4.1 - BC: Changed all enum interfaces to extend the root `EnumInterface` - BC: added the `iso2Code()` and the `getName()` methods to the `Country` interface diff --git a/src/resources/database/migrations/2019_08_10_175251_streamline_provinces_table.php b/src/resources/database/migrations/2019_08_10_175251_streamline_provinces_table.php index 3d2559d..661e1c6 100644 --- a/src/resources/database/migrations/2019_08_10_175251_streamline_provinces_table.php +++ b/src/resources/database/migrations/2019_08_10_175251_streamline_provinces_table.php @@ -4,28 +4,10 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; -use Illuminate\Support\Facades\DB; use Konekt\Address\Models\ProvinceTypeProxy; class StreamlineProvincesTable extends Migration { - /** - * With Laravel up to v5.8 renaming any column in a table that also has a column - * of type enum is not currently supported. This problem only seems to affect - * MySQL, this workaround provides a bit dirty but working solution for it - * - * @see https://laravel.com/docs/5.8/migrations#modifying-columns - * @see https://stackoverflow.com/q/33140860/1016746 - */ - public function __construct() - { - $platform = DB::getDoctrineConnection()->getDatabasePlatform(); - - if (!$platform->hasDoctrineTypeMappingFor('enum')) { - $platform->registerDoctrineTypeMapping('enum', 'string'); - } - } - public function up() { /** based on ISO 3166-2 https://en.wikipedia.org/wiki/ISO_3166-2 */