<?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');
    }
};
