<?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
    {
        $sql = <<<'SQL'
            ALTER TABLE alert_mail_rules
            ADD COLUMN invoice_master_id BIGINT DEFAULT NULL,
            ADD CONSTRAINT invoice_masters_invoice_master_id_fkey
            FOREIGN KEY (invoice_master_id) REFERENCES invoice_masters(id);
        SQL;

        DB::statement($sql);
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        // Schema::table('alert_mail_rules', function (Blueprint $table) {
        //     //
        // });
    }
};
