From a55a9ca4cde886e07ebdfe48a50cf2455cf7d17b Mon Sep 17 00:00:00 2001 From: Antti Date: Wed, 25 Jul 2018 06:57:47 +0300 Subject: [PATCH] Fix: Made migration run original command for mysql (#5915) * Fix: Made migration run original command for mysql * Added sqlite_testing migration * Review suggested fix --- ...2016_12_27_212631_make_asset_assigned_to_polymorphic.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/database/migrations/2016_12_27_212631_make_asset_assigned_to_polymorphic.php b/database/migrations/2016_12_27_212631_make_asset_assigned_to_polymorphic.php index 3973abbcc3..772bd170a5 100644 --- a/database/migrations/2016_12_27_212631_make_asset_assigned_to_polymorphic.php +++ b/database/migrations/2016_12_27_212631_make_asset_assigned_to_polymorphic.php @@ -18,9 +18,9 @@ class MakeAssetAssignedToPolymorphic extends Migration Schema::table('assets', function (Blueprint $table) { $table->string('assigned_type')->nullable(); }); - - // Prior to this migration, asset's could only be assigned to users. - Asset::whereNotNull('assigned_to')->orWhere('assigned_to', '!=', null)->update(['assigned_type' => User::class]); + if(config('database.default') == 'mysql') { + Asset::whereNotNull('assigned_to')->orWhere('assigned_to', '!=', '')->update(['assigned_type' => User::class]); + } } /**