<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        if (! Schema::hasTable('investment_settings') || ! Schema::hasColumn('investment_settings', 'accrual_frequency')) {
            return;
        }

        DB::table('investment_settings')->update([
            'accrual_frequency' => 'monthly',
        ]);
    }
};
