pertama
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('master_provinsi', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->timestamps();
|
||||
|
||||
$table->softDeletes();
|
||||
|
||||
$table->string('nama');
|
||||
$table->string('kode', 2);
|
||||
});
|
||||
|
||||
Schema::create('master_kabupaten_kota', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->timestamps();
|
||||
|
||||
$table->softDeletes();
|
||||
|
||||
$table->string('nama');
|
||||
$table->string('kode', 4);
|
||||
|
||||
$table->foreignId('provinsi_id')->constrained('master_provinsi');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('master_kabupaten_kota');
|
||||
Schema::dropIfExists('master_provinsi');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user