<?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('ms_kabupaten', function (Blueprint $table) {
            $table->id('MsKabupatenId');
            $table->integer('ms_provinsi_id');
            $table->string('name');
            $table->string('kode_wilayah');
            $table->timestampsTz();

            $table->foreign('ms_provinsi_id')->references('MsProvinsiId')->on('ms_provinsi')->onDelete('cascade');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('kabupatens');
    }
};
