model/model_id is now required on products
This commit is contained in:
parent
72648ea14d
commit
25dab73a83
32
database/migrations/2023_05_03_223721_product_model.php
Normal file
32
database/migrations/2023_05_03_223721_product_model.php
Normal 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');
|
||||||
|
}
|
||||||
|
};
|
Loading…
Reference in New Issue
Block a user