diff --git a/database/migrations/2026_02_05_100003_create_card_transactions_table.php b/database/migrations/2026_02_05_100003_create_card_transactions_table.php new file mode 100644 index 0000000..9a55734 --- /dev/null +++ b/database/migrations/2026_02_05_100003_create_card_transactions_table.php @@ -0,0 +1,36 @@ +id(); + $table->unsignedBigInteger('tenant_id'); + $table->unsignedBigInteger('card_id')->nullable(); // corporate_cards.id + $table->date('transaction_date'); // 거래일 + $table->string('time', 10)->nullable(); // 시간 (HH:MM) + $table->string('merchant', 200); // 가맹점명 + $table->string('category', 50)->nullable(); // 카테고리 + $table->bigInteger('amount')->default(0); // 금액 (음수=취소) + $table->string('approval_no', 50)->nullable(); // 승인번호 + $table->string('status', 20)->default('approved'); // approved, cancelled + $table->text('memo')->nullable(); + $table->timestamps(); + $table->softDeletes(); + $table->index(['tenant_id', 'transaction_date']); + $table->index(['tenant_id', 'card_id']); + }); + } + + public function down(): void + { + Schema::dropIfExists('card_transactions'); + } +};