<?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
    {
        $sql1 = <<<'SQL'
        ALTER TABLE class_characteristics
        ADD COLUMN mark_status TEXT DEFAULT NULL
        SQL;

        DB::statement($sql1);

        $sql2 = <<<'SQL'
        ALTER TABLE class_characteristics
        ADD COLUMN marked_datetime TEXT DEFAULT NULL
        SQL;

        DB::statement($sql2);

        $sql3 = <<<'SQL'
        ALTER TABLE class_characteristics
        ADD COLUMN marked_by TEXT DEFAULT NULL
        SQL;

        DB::statement($sql3);

        $sql4 = <<<'SQL'
        ALTER TABLE class_characteristics
        ADD COLUMN man_marked_status TEXT DEFAULT NULL
        SQL;

        DB::statement($sql4);

        $sql5 = <<<'SQL'
        ALTER TABLE class_characteristics
        ADD COLUMN man_marked_datetime TEXT DEFAULT NULL
        SQL;

        DB::statement($sql5);

        $sql6 = <<<'SQL'
        ALTER TABLE class_characteristics
        ADD COLUMN man_marked_by TEXT DEFAULT NULL
        SQL;

        DB::statement($sql6);

        $sql7 = <<<'SQL'
        ALTER TABLE class_characteristics
        ADD COLUMN motor_marked_status TEXT DEFAULT NULL
        SQL;

        DB::statement($sql7);

        $sql8 = <<<'SQL'
        ALTER TABLE class_characteristics
        ADD COLUMN pump_marked_status TEXT DEFAULT NULL
        SQL;

        DB::statement($sql8);

        $sql9 = <<<'SQL'
        ALTER TABLE class_characteristics
        ADD COLUMN motor_pump_pumpset_status TEXT DEFAULT NULL
        SQL;

        DB::statement($sql9);

        $sql10 = <<<'SQL'
        ALTER TABLE class_characteristics
        ADD COLUMN part_validation_1 TEXT DEFAULT NULL
        SQL;

        DB::statement($sql10);

        $sql11 = <<<'SQL'
        ALTER TABLE class_characteristics
        ADD COLUMN part_validation_2 TEXT DEFAULT NULL
        SQL;

        DB::statement($sql11);

        $sql12 = <<<'SQL'
        ALTER TABLE class_characteristics
        ADD COLUMN samlight_logged_name TEXT DEFAULT NULL
        SQL;

        DB::statement($sql12);

         $sql13 = <<<'SQL'
        ALTER TABLE class_characteristics
        ADD COLUMN pending_released_status INTEGER DEFAULT 0
        SQL;

        DB::statement($sql13);

        $sql14 = <<<'SQL'
        ALTER TABLE class_characteristics
        ADD COLUMN expected_time TEXT DEFAULT NULL
        SQL;

        DB::statement($sql14);

        $sql15 = <<<'SQL'
        ALTER TABLE class_characteristics
        ADD COLUMN machine_id BIGINT NOT NULL,
        ADD CONSTRAINT class_characteristics_machine_id_fkey
        FOREIGN KEY (machine_id) REFERENCES machines(id);
        SQL;

        DB::statement($sql15);


    }

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