41 lines
1.0 KiB
PHP
41 lines
1.0 KiB
PHP
|
<?php
|
||
|
|
||
|
use Illuminate\Support\Facades\Schema;
|
||
|
use Illuminate\Database\Schema\Blueprint;
|
||
|
use Illuminate\Database\Migrations\Migration;
|
||
|
use Modules\Master\Entities\Province;
|
||
|
|
||
|
return new class extends Migration
|
||
|
{
|
||
|
/**
|
||
|
* Run the migrations.
|
||
|
*
|
||
|
* @return void
|
||
|
*/
|
||
|
public function up()
|
||
|
{
|
||
|
Schema::create('cities', function (Blueprint $table) {
|
||
|
$table->id();
|
||
|
$table->foreignIdFor(Province::class)->constrained()->onDelete('cascade');
|
||
|
$table->string('code', 5);
|
||
|
$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('cities');
|
||
|
}
|
||
|
};
|