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']); + }); + } +};