mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 21:54:14 -08:00
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:
parent
e332442132
commit
a55a9ca4cd
|
@ -18,9 +18,9 @@ class MakeAssetAssignedToPolymorphic extends Migration
|
||||||
Schema::table('assets', function (Blueprint $table) {
|
Schema::table('assets', function (Blueprint $table) {
|
||||||
$table->string('assigned_type')->nullable();
|
$table->string('assigned_type')->nullable();
|
||||||
});
|
});
|
||||||
|
if(config('database.default') == 'mysql') {
|
||||||
// Prior to this migration, asset's could only be assigned to users.
|
Asset::whereNotNull('assigned_to')->orWhere('assigned_to', '!=', '')->update(['assigned_type' => User::class]);
|
||||||
Asset::whereNotNull('assigned_to')->orWhere('assigned_to', '!=', null)->update(['assigned_type' => User::class]);
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue