From 566d3b6c4f6605d0fb9057f1043c1d3b568afc2c Mon Sep 17 00:00:00 2001 From: Hegifebrianto Date: Fri, 14 Feb 2025 18:15:31 +0700 Subject: [PATCH] chore-add-migration-kasmasuk --- ..._084000_add_coa_id_to_kas_masuks_table.php | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 database/migrations/2025_02_14_084000_add_coa_id_to_kas_masuks_table.php diff --git a/database/migrations/2025_02_14_084000_add_coa_id_to_kas_masuks_table.php b/database/migrations/2025_02_14_084000_add_coa_id_to_kas_masuks_table.php new file mode 100644 index 0000000..dafa208 --- /dev/null +++ b/database/migrations/2025_02_14_084000_add_coa_id_to_kas_masuks_table.php @@ -0,0 +1,23 @@ +unsignedBigInteger('coa_id')->nullable()->after('user_id'); // Tambahkan kolom COA + $table->foreign('coa_id')->references('id')->on('coas')->onDelete('set null'); // Relasi ke tabel COA + }); + } + + public function down() + { + Schema::table('kas_masuks', function (Blueprint $table) { + $table->dropForeign(['coa_id']); + $table->dropColumn('coa_id'); + }); + } +};