From d0418eeb85e7f6be9d7f9826969e9be2e388e704 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=B3=B4=EA=B3=A4?= Date: Tue, 10 Feb 2026 17:58:20 +0900 Subject: [PATCH] =?UTF-8?q?feat:journal=5Fentries=EC=97=90=20source=5Ftype?= =?UTF-8?q?,=20source=5Fkey=20=EC=BB=AC=EB=9F=BC=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 원본 거래 추적용 source_type(bank_transaction, hometax_invoice, manual) 컬럼 추가 - 원본 거래 고유키 source_key 컬럼 추가 - tenant_id + source_type + source_key 복합 인덱스 추가 Co-Authored-By: Claude Opus 4.6 --- ...0_add_source_fields_to_journal_entries.php | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 database/migrations/2026_02_10_100000_add_source_fields_to_journal_entries.php diff --git a/database/migrations/2026_02_10_100000_add_source_fields_to_journal_entries.php b/database/migrations/2026_02_10_100000_add_source_fields_to_journal_entries.php new file mode 100644 index 0000000..a7f7f56 --- /dev/null +++ b/database/migrations/2026_02_10_100000_add_source_fields_to_journal_entries.php @@ -0,0 +1,28 @@ +string('source_type', 30)->nullable()->after('status') + ->comment('원본 거래 유형: bank_transaction, hometax_invoice, manual'); + $table->string('source_key', 255)->nullable()->after('source_type') + ->comment('원본 거래 고유키'); + + $table->index(['tenant_id', 'source_type', 'source_key'], 'je_source_idx'); + }); + } + + public function down(): void + { + Schema::table('journal_entries', function (Blueprint $table) { + $table->dropIndex('je_source_idx'); + $table->dropColumn(['source_type', 'source_key']); + }); + } +};