Master/Database/Migrations/2023_06_04_030454_create_provinces_table.php

41 lines
1.0 KiB
PHP
Raw Normal View History

2023-06-04 14:09:39 +00:00
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Modules\Master\Entities\Country;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('provinces', function (Blueprint $table) {
$table->id();
$table->foreignIdFor(Country::class)->constrained()->onDelete('cascade');
$table->string('code', 2);
$table->string('name');
$table->string('status', 1)->default('1');
$table->timestamps();
$table->softDeletes();
$table->unsignedBigInteger("created_by")->nullable();
$table->unsignedBigInteger("updated_by")->nullable();
$table->unsignedBigInteger("deleted_by")->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('provinces');
}
};