diff --git a/database/migrations/2026_02_05_100001_create_daily_fund_transactions_table.php b/database/migrations/2026_02_05_100001_create_daily_fund_transactions_table.php new file mode 100644 index 0000000..5182169 --- /dev/null +++ b/database/migrations/2026_02_05_100001_create_daily_fund_transactions_table.php @@ -0,0 +1,36 @@ +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'); + } +}; diff --git a/database/migrations/2026_02_05_100002_create_daily_fund_memos_table.php b/database/migrations/2026_02_05_100002_create_daily_fund_memos_table.php new file mode 100644 index 0000000..36cf021 --- /dev/null +++ b/database/migrations/2026_02_05_100002_create_daily_fund_memos_table.php @@ -0,0 +1,28 @@ +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'); + } +};