Skip to content

A free open source IT asset/license management system

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

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