Fix: Made migration run original command for mysql (#5915)

* Fix: Made migration run original command for mysql

* Added sqlite_testing migration

* Review suggested fix
This commit is contained in:
Antti 2018-07-25 06:57:47 +03:00 committed by snipe
parent e332442132
commit a55a9ca4cd

View file

@ -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]);
}
}
/**