<?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()
    {
        DB::statement("
        CREATE UNIQUE INDEX uniq_pointplan_active
        ON point_plans (point_id, day, \"timeStart\", request_id)
        WHERE is_active = true
    ");
    }
    public function down()
    {
        DB::statement("DROP INDEX uniq_pointplan_active;");
    }

};
