diff --git a/database/migrations/2026_08_03_093052_seed_core_permissions.php b/database/migrations/2026_08_03_093052_seed_core_permissions.php new file mode 100644 index 0000000..556728c --- /dev/null +++ b/database/migrations/2026_08_03_093052_seed_core_permissions.php @@ -0,0 +1,85 @@ +where('key', $key)->exists(); + + if ($exists) { + DB::table('permissions')->where('key', $key)->update([ + 'group' => $group, + 'label' => $label, + 'description' => $description ?: null, + 'updated_at' => $now, + ]); + } else { + DB::table('permissions')->insert([ + 'key' => $key, + 'group' => $group, + 'label' => $label, + 'description' => $description ?: null, + 'created_at' => $now, + 'updated_at' => $now, + ]); + } + } + } + + public function down(): void + { + // Tidak menghapus — hanya migrasi perbaikan data. + } +}; diff --git a/database/migrations/2026_08_03_095250_seed_core_permissions.php b/database/migrations/2026_08_03_095250_seed_core_permissions.php new file mode 100644 index 0000000..88fa2f3 --- /dev/null +++ b/database/migrations/2026_08_03_095250_seed_core_permissions.php @@ -0,0 +1,24 @@ +