File: /var/www/admin.javaapp.co.uk/database/migrations/2023_02_20_111722_create_in_house_orders_table.php
<?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()
{
Schema::create('in_house_orders', function (Blueprint $table) {
$table->id();
$table->foreignId('user_id')->nullable()->constrained('users')->onDelete('cascade');
$table->string('customized_order')->default('');
$table->tinyInteger('type')->default(0)->comment("1 = size, 2 = milk , 3 = sugar");
$table->tinyInteger('is_active')->default(1)->comment("1 = active 2 = in_active 3 = deleted");
$table->unsignedInteger('created_at')->default(0);
$table->unsignedInteger('updated_at')->default(0);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('in_house_orders', function (Blueprint $table) {
$table->dropConstrainedForeignId('user_id');
});
Schema::dropIfExists('in_house_orders');
}
};