From 6c0c47751ce151312943074148fb9661646be863 Mon Sep 17 00:00:00 2001 From: "fauzgabriel@gmail.com" Date: Mon, 18 May 2026 14:41:31 +0700 Subject: [PATCH] add column uid lahan profile --- app/Models/Map/Lahan.php | 1 + ...026_02_19_172905_create_profiles_table.php | 2 + ...26_05_18_112159_add_uid_to_map_tanaman.php | 39 +++++++++++++++++++ 3 files changed, 42 insertions(+) create mode 100644 database/migrations/2026_05_18_112159_add_uid_to_map_tanaman.php diff --git a/app/Models/Map/Lahan.php b/app/Models/Map/Lahan.php index 78534c7..f0dcc6c 100644 --- a/app/Models/Map/Lahan.php +++ b/app/Models/Map/Lahan.php @@ -17,6 +17,7 @@ class Lahan extends Model 'status_kepemilikan', 'profile_id', 'desa_kelurahan_id', + 'uid', 'path', 'luas_lahan', 'created_by', diff --git a/database/migrations/2026_02_19_172905_create_profiles_table.php b/database/migrations/2026_02_19_172905_create_profiles_table.php index 1423340..9d605b5 100644 --- a/database/migrations/2026_02_19_172905_create_profiles_table.php +++ b/database/migrations/2026_02_19_172905_create_profiles_table.php @@ -51,6 +51,7 @@ return new class extends Migration Schema::create('profiles', function (Blueprint $table) { $table->id(); $table->foreignId('user_id')->constrained(); + $table->string('user_uid'); $table->string('role')->nullable(); $table->string('nama'); @@ -67,6 +68,7 @@ return new class extends Migration $table->string('file_kk')->nullable(); $table->string('path_ktp', 500)->nullable(); $table->string('file_ktp')->nullable(); + $table->string('user_uid'); $table->foreignId('keluarga_id')->nullable()->constrained('keluarga')->onDelete('set null'); diff --git a/database/migrations/2026_05_18_112159_add_uid_to_map_tanaman.php b/database/migrations/2026_05_18_112159_add_uid_to_map_tanaman.php new file mode 100644 index 0000000..4f41d03 --- /dev/null +++ b/database/migrations/2026_05_18_112159_add_uid_to_map_tanaman.php @@ -0,0 +1,39 @@ +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']); + }); + } +};