feat:카드 사용내역 금액 수정 마이그레이션 추가
- modified_supply_amount, modified_tax 컬럼 추가 (사용자 수정 공급가액/부가세) - barobill_card_transaction_amount_logs 이력 테이블 생성 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('barobill_card_transactions', function (Blueprint $table) {
|
||||
$table->decimal('modified_supply_amount', 18, 2)->nullable()->after('tax')
|
||||
->comment('사용자 수정 공급가액 (null이면 원본값 사용)');
|
||||
$table->decimal('modified_tax', 18, 2)->nullable()->after('modified_supply_amount')
|
||||
->comment('사용자 수정 부가세 (null이면 원본값 사용)');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('barobill_card_transactions', function (Blueprint $table) {
|
||||
$table->dropColumn(['modified_supply_amount', 'modified_tax']);
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('barobill_card_transaction_amount_logs', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('card_transaction_id')->constrained('barobill_card_transactions')->onDelete('cascade')
|
||||
->comment('카드 거래 ID');
|
||||
$table->string('original_unique_key', 255)->comment('거래 고유키 (cardNum|useDt|approvalNum|amount)');
|
||||
$table->decimal('before_supply_amount', 18, 2)->comment('변경 전 공급가액');
|
||||
$table->decimal('before_tax', 18, 2)->comment('변경 전 부가세');
|
||||
$table->decimal('after_supply_amount', 18, 2)->comment('변경 후 공급가액');
|
||||
$table->decimal('after_tax', 18, 2)->comment('변경 후 부가세');
|
||||
$table->unsignedBigInteger('modified_by')->nullable()->comment('수정자 ID');
|
||||
$table->string('modified_by_name', 100)->nullable()->comment('수정자 이름');
|
||||
$table->string('ip_address', 45)->nullable()->comment('수정자 IP');
|
||||
$table->timestamp('created_at')->useCurrent()->comment('수정 시각');
|
||||
|
||||
$table->index('card_transaction_id', 'bb_amount_log_trans_idx');
|
||||
$table->index('original_unique_key', 'bb_amount_log_key_idx');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('barobill_card_transaction_amount_logs');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user