<?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('clients', function (Blueprint $table) {
            $table->decimal('outstanding_balance', 15, 2)->default(0)->after('memo')->comment('미수금 잔액');
            $table->decimal('credit_limit', 15, 2)->default(0)->after('outstanding_balance')->comment('여신 한도');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('clients', function (Blueprint $table) {
            $table->dropColumn(['outstanding_balance', 'credit_limit']);
        });
    }
};
