<?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('contract_settings', function (Blueprint $table): void {
            $table->id();
            $table->boolean('create_activity_on_balance_change')->default(false);
            $table->foreignId('default_action_id')->nullable()->constrained('actions')->nullOnDelete();
            $table->foreignId('default_decision_id')->nullable()->constrained('decisions')->nullOnDelete();
            $table->string('activity_note_template', 255)->nullable();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('contract_settings');
    }
};
