program dan basis data ekosistem

This commit is contained in:
2026-04-20 16:05:27 +07:00
parent 0bbcb22d50
commit 4032eb6e75
49 changed files with 4384 additions and 155 deletions
@@ -0,0 +1,74 @@
<?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('core_program', function (Blueprint $table) {
$table->id();
$table->string('nama');
$table->string('sub_domain');
$table->integer('tahun');
$table->string('instansi')->nullable();
$table->foreignId('created_by')->nullable()->constrained('users')->onDelete('set null');
$table->foreignId('updated_by')->nullable()->constrained('users')->onDelete('set null');
$table->foreignId('deleted_by')->nullable()->constrained('users')->onDelete('set null');
$table->timestamps();
$table->softDeletes();
});
Schema::create('core_program_komoditas', function (Blueprint $table) {
$table->id();
$table->foreignId('program_id')->nullable()->constrained('core_program')->nullOnDelete();
$table->foreignId('komoditas_id')->nullable()->constrained('master_komoditas')->nullOnDelete();
$table->boolean('default')->default(false);
$table->foreignId('created_by')->nullable()->constrained('users')->onDelete('set null');
$table->foreignId('updated_by')->nullable()->constrained('users')->onDelete('set null');
$table->foreignId('deleted_by')->nullable()->constrained('users')->onDelete('set null');
$table->timestamps();
$table->softDeletes();
});
Schema::create('core_program_lokasi', function (Blueprint $table) {
$table->id();
$table->foreignId('program_id')->nullable()->constrained('core_program')->nullOnDelete();
$table->foreignId('provinsi_id')->nullable()->constrained('master_provinsi')->nullOnDelete();
$table->foreignId('kabupaten_kota_id')->nullable()->constrained('master_kabupaten_kota')->nullOnDelete();
$table->foreignId('kecamatan_id')->nullable()->constrained('master_kecamatan')->nullOnDelete();
$table->foreignId('desa_kelurahan_id')->nullable()->constrained('master_desa_kelurahan')->nullOnDelete();
$table->boolean('default')->default(false);
$table->foreignId('created_by')->nullable()->constrained('users')->onDelete('set null');
$table->foreignId('updated_by')->nullable()->constrained('users')->onDelete('set null');
$table->foreignId('deleted_by')->nullable()->constrained('users')->onDelete('set null');
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('core_program_lokasi');
Schema::dropIfExists('core_program_komoditas');
Schema::dropIfExists('core_program');
}
};