model/model_id is now required on products

This commit is contained in:
Deon George 2023-05-03 22:41:45 +10:00
parent 72648ea14d
commit 25dab73a83

View File

@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
DB::statement('ALTER TABLE products MODIFY model_id int unsigned NOT NULL');
DB::statement('ALTER TABLE products MODIFY model varchar(255) NOT NULL');
DB::statement('ALTER TABLE services MODIFY model varchar(255) NOT NULL');
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
DB::statement('ALTER TABLE products MODIFY model_id int unsigned DEFAULT NULL');
DB::statement('ALTER TABLE products MODIFY model varchar(255) DEFAULT NULL');
DB::statement('ALTER TABLE services MODIFY model varchar(255) DEFAULT NULL');
}
};