<?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 sticker_structure_details
            ADD COLUMN plant_id BIGINT NOT NULL,
            ADD CONSTRAINT sticker_structure_details_plant_id_fkey
            FOREIGN KEY (plant_id) REFERENCES plants(id);
        SQL;

        DB::statement($sql1);

        $sql2 = <<<'SQL'
        ALTER TABLE sticker_structure_details
        ADD COLUMN item_characteristic_id BIGINT NULL,
        ADD CONSTRAINT sticker_structure_details_item_characteristic_id_fkey
        FOREIGN KEY (item_characteristic_id) REFERENCES item_characteristics(id);
        SQL;

        DB::statement($sql2);
    }

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