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

36 lines
860 B
PHP
Executable File

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