fix:이력 테이블 외래키 이름 길이 초과 수정

- MySQL 64자 제한으로 자동생성 외래키명 실패
- foreignId()->constrained() → 수동 foreign() + 짧은 이름(bb_amount_log_trans_fk)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
김보곤
2026-02-05 10:49:53 +09:00
parent ba34fb09df
commit 98ab3dac9a

View File

@@ -13,8 +13,9 @@ public function up(): void
{ {
Schema::create('barobill_card_transaction_amount_logs', function (Blueprint $table) { Schema::create('barobill_card_transaction_amount_logs', function (Blueprint $table) {
$table->id(); $table->id();
$table->foreignId('card_transaction_id')->constrained('barobill_card_transactions')->onDelete('cascade') $table->unsignedBigInteger('card_transaction_id')->comment('카드 거래 ID');
->comment('카드 거래 ID'); $table->foreign('card_transaction_id', 'bb_amount_log_trans_fk')
->references('id')->on('barobill_card_transactions')->onDelete('cascade');
$table->string('original_unique_key', 255)->comment('거래 고유키 (cardNum|useDt|approvalNum|amount)'); $table->string('original_unique_key', 255)->comment('거래 고유키 (cardNum|useDt|approvalNum|amount)');
$table->decimal('before_supply_amount', 18, 2)->comment('변경 전 공급가액'); $table->decimal('before_supply_amount', 18, 2)->comment('변경 전 공급가액');
$table->decimal('before_tax', 18, 2)->comment('변경 전 부가세'); $table->decimal('before_tax', 18, 2)->comment('변경 전 부가세');