mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-09 23:24:06 -08:00
Add conditionals
This commit is contained in:
parent
e6dc61d2cf
commit
760844de6f
|
@ -48,13 +48,19 @@ class MigrateMacAddress extends Migration
|
||||||
*/
|
*/
|
||||||
public function down()
|
public function down()
|
||||||
{
|
{
|
||||||
//
|
|
||||||
$f = \App\Models\CustomFieldset::where(['name' => 'Asset with MAC Address'])->first();
|
$f = \App\Models\CustomFieldset::where(['name' => 'Asset with MAC Address'])->first();
|
||||||
$f->fields()->delete();
|
|
||||||
$f->delete();
|
if ($f) {
|
||||||
|
$f->fields()->delete();
|
||||||
|
$f->delete();
|
||||||
|
}
|
||||||
|
|
||||||
Schema::table('models', function (Blueprint $table) {
|
Schema::table('models', function (Blueprint $table) {
|
||||||
$table->renameColumn('deprecated_mac_address', 'show_mac_address');
|
$table->renameColumn('deprecated_mac_address', 'show_mac_address');
|
||||||
});
|
});
|
||||||
DB::statement('ALTER TABLE assets CHANGE _snipeit_mac_address_1 mac_address varchar(255)');
|
|
||||||
|
if (Schema::hasColumn('assets', '_snipeit_mac_address')) {
|
||||||
|
DB::statement('ALTER TABLE assets CHANGE _snipeit_mac_address mac_address varchar(255)');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue