From b4e58cc1bbfd74b8b3d1c63d4986a3efc44df8f9 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Mon, 15 Jun 2020 18:35:53 +0200 Subject: [PATCH 1/4] Updated doctrine config for v3 --- composer.json | 2 +- migrations.php | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 997f8558..86e35f3f 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,7 @@ "cocur/slugify": "^4.0", "doctrine/cache": "^1.9", "doctrine/dbal": "^2.10", - "doctrine/migrations": "^2.2", + "doctrine/migrations": "^3.0.1", "doctrine/orm": "^2.7", "endroid/qr-code": "^3.6", "geoip2/geoip2": "^2.9", diff --git a/migrations.php b/migrations.php index 364f52ad..0341745e 100644 --- a/migrations.php +++ b/migrations.php @@ -4,8 +4,11 @@ declare(strict_types=1); return [ 'name' => 'ShlinkMigrations', - 'migrations_namespace' => 'ShlinkMigrations', - 'table_name' => 'migrations', - 'migrations_directory' => 'data/migrations', + 'migrations_paths' => [ + 'ShlinkMigrations' => 'data/migrations', + ], + 'table_storage' => [ + 'table_name' => 'migrations', + ], 'custom_template' => 'data/migrations_template.txt', ]; From eed353fedf89f92100ef992fae1fc73a80f4cce8 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sun, 21 Jun 2020 12:29:56 +0200 Subject: [PATCH 2/4] Updated migration template --- data/migrations_template.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/migrations_template.txt b/data/migrations_template.txt index c7b938f2..482236e6 100644 --- a/data/migrations_template.txt +++ b/data/migrations_template.txt @@ -7,7 +7,7 @@ namespace ; use Doctrine\DBAL\Schema\Schema; use Doctrine\Migrations\AbstractMigration; -final class Version extends AbstractMigration +final class extends AbstractMigration { public function up(Schema $schema): void { From 6b3fd2ac83b1dabd1e3af0c1238c09855db9d0d3 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sun, 21 Jun 2020 13:00:32 +0200 Subject: [PATCH 3/4] Commented out name config option for migrations, since it makes it fail --- migrations.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/migrations.php b/migrations.php index 0341745e..8d11ab91 100644 --- a/migrations.php +++ b/migrations.php @@ -3,7 +3,8 @@ declare(strict_types=1); return [ - 'name' => 'ShlinkMigrations', + +// 'name' => 'ShlinkMigrations', 'migrations_paths' => [ 'ShlinkMigrations' => 'data/migrations', ], @@ -11,4 +12,5 @@ return [ 'table_name' => 'migrations', ], 'custom_template' => 'data/migrations_template.txt', + ]; From f44540f95e60e7cc1277e85cc781d16a229061fe Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sun, 21 Jun 2020 13:01:10 +0200 Subject: [PATCH 4/4] Updated changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b2358670..4f01eecc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com), and this #### Changed * [#508](https://github.com/shlinkio/shlink/issues/508) Added mutation checks to database tests. +* [#790](https://github.com/shlinkio/shlink/issues/790) Updated to doctrine/migrations v3. #### Deprecated