From 3b8e999223e8fcc3306600cc871c2715a21ff769 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Burak=20=C3=87ak=C4=B1rel?= Date: Wed, 2 Jun 2021 17:43:38 +0300 Subject: [PATCH] Added missing migration from 2.1.12 --- app/Listeners/Update/V21/Version2114.php | 12 +++++++ app/Listeners/Update/V21/Version2116.php | 44 ++++++++++++++++++++++++ app/Providers/Event.php | 1 + 3 files changed, 57 insertions(+) create mode 100644 app/Listeners/Update/V21/Version2116.php diff --git a/app/Listeners/Update/V21/Version2114.php b/app/Listeners/Update/V21/Version2114.php index a409ba6cb..6720bc357 100644 --- a/app/Listeners/Update/V21/Version2114.php +++ b/app/Listeners/Update/V21/Version2114.php @@ -30,6 +30,18 @@ class Version2114 extends Listener return; } + $migration = DB::table('migrations') + ->where('migration', '2016_06_27_000001_create_mediable_test_tables') + ->first(); + + if ($migration === null) { + DB::table('migrations')->insert([ + 'id' => DB::table('migrations')->max('id') + 1, + 'migration' => '2016_06_27_000001_create_mediable_test_tables', + 'batch' => DB::table('migrations')->max('batch') + 1, + ]); + } + Artisan::call('migrate', ['--force' => true]); $this->updateMediaTables(); diff --git a/app/Listeners/Update/V21/Version2116.php b/app/Listeners/Update/V21/Version2116.php new file mode 100644 index 000000000..1e9ad7217 --- /dev/null +++ b/app/Listeners/Update/V21/Version2116.php @@ -0,0 +1,44 @@ +skipThisUpdate($event)) { + return; + } + + $migration = DB::table('migrations') + ->where('migration', '2016_06_27_000001_create_mediable_test_tables') + ->first(); + + if ($migration === null) { + DB::table('migrations')->insert([ + 'id' => DB::table('migrations')->max('id') + 1, + 'migration' => '2016_06_27_000001_create_mediable_test_tables', + 'batch' => DB::table('migrations')->max('batch') + 1, + ]); + } + + Artisan::call('migrate', ['--force' => true]); + + } +} diff --git a/app/Providers/Event.php b/app/Providers/Event.php index 766c9a89a..a07c34b5a 100644 --- a/app/Providers/Event.php +++ b/app/Providers/Event.php @@ -32,6 +32,7 @@ class Event extends Provider 'App\Listeners\Update\V21\Version219', 'App\Listeners\Update\V21\Version2112', 'App\Listeners\Update\V21\Version2114', + 'App\Listeners\Update\V21\Version2116', ], 'Illuminate\Auth\Events\Login' => [ 'App\Listeners\Auth\Login',