add column uid lahan profile

This commit is contained in:
2026-05-18 14:41:31 +07:00
parent 75d679f492
commit 6c0c47751c
3 changed files with 42 additions and 0 deletions
+1
View File
@@ -17,6 +17,7 @@ class Lahan extends Model
'status_kepemilikan', 'status_kepemilikan',
'profile_id', 'profile_id',
'desa_kelurahan_id', 'desa_kelurahan_id',
'uid',
'path', 'path',
'luas_lahan', 'luas_lahan',
'created_by', 'created_by',
@@ -51,6 +51,7 @@ return new class extends Migration
Schema::create('profiles', function (Blueprint $table) { Schema::create('profiles', function (Blueprint $table) {
$table->id(); $table->id();
$table->foreignId('user_id')->constrained(); $table->foreignId('user_id')->constrained();
$table->string('user_uid');
$table->string('role')->nullable(); $table->string('role')->nullable();
$table->string('nama'); $table->string('nama');
@@ -67,6 +68,7 @@ return new class extends Migration
$table->string('file_kk')->nullable(); $table->string('file_kk')->nullable();
$table->string('path_ktp', 500)->nullable(); $table->string('path_ktp', 500)->nullable();
$table->string('file_ktp')->nullable(); $table->string('file_ktp')->nullable();
$table->string('user_uid');
$table->foreignId('keluarga_id')->nullable()->constrained('keluarga')->onDelete('set null'); $table->foreignId('keluarga_id')->nullable()->constrained('keluarga')->onDelete('set null');
@@ -0,0 +1,39 @@
<?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::table('map_lahan', function (Blueprint $table) {
//
$table->string('uid')->unique(); // LH-1234567890&0987654321 (sepuluh digit user - 10 digit lahan)
});
Schema::table('map_tanaman', function(Blueprint $table){
$table->string('uid')->unique(); //// LH-1234567890&0987654321&5432167890
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('map_lahan', function (Blueprint $table) {
$table->dropUnique(['uid']);
$table->dropColumn(['uid']);
});
Schema::table('map_tanaman', function (Blueprint $table) {
$table->dropUnique(['uid']);
$table->dropColumn(['uid']);
});
}
};