feat:일일자금일보 마이그레이션 추가 (daily_fund_transactions, daily_fund_memos)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
김보곤
2026-02-05 07:43:55 +09:00
parent 422bad7dfc
commit 00470b7d30
2 changed files with 64 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
public function up(): void
{
if (Schema::hasTable('daily_fund_transactions')) {
return;
}
Schema::create('daily_fund_transactions', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('tenant_id');
$table->date('transaction_date'); // 거래일
$table->string('type', 20); // income, expense
$table->string('time', 10)->nullable(); // 시간 (HH:MM)
$table->unsignedBigInteger('account_id')->nullable(); // 계좌ID (corporate_cards 등과 연동 가능)
$table->string('account_name', 50)->nullable(); // 계좌/은행명 (간편 저장용)
$table->string('description', 200); // 적요
$table->bigInteger('amount')->default(0); // 금액
$table->string('category', 50)->nullable(); // 카테고리
$table->string('note', 200)->nullable(); // 비고
$table->timestamps();
$table->softDeletes();
$table->index(['tenant_id', 'transaction_date']);
$table->index(['tenant_id', 'type']);
});
}
public function down(): void
{
Schema::dropIfExists('daily_fund_transactions');
}
};

View File

@@ -0,0 +1,28 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
public function up(): void
{
if (Schema::hasTable('daily_fund_memos')) {
return;
}
Schema::create('daily_fund_memos', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('tenant_id');
$table->date('memo_date')->comment('해당 날짜');
$table->text('memo')->nullable();
$table->string('author', 50)->nullable();
$table->timestamps();
$table->unique(['tenant_id', 'memo_date']);
});
}
public function down(): void
{
Schema::dropIfExists('daily_fund_memos');
}
};