survey-sdgs/database/migrations/2021_09_12_221935_create_ke...

35 lines
804 B
PHP
Executable File

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateKecamatanTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('kecamatan', function (Blueprint $table) {
$table->id();
$table->foreignId('kabupaten_id')->constrained('kabupaten')->onUpdate('cascade')->onDelete('cascade');
$table->string('nama');
$table->json('coordinate')->nullable();
$table->json('geojson')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('kecamatan');
}
}