<?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
    {
        Schema::table('fatturazione', function (Blueprint $table) {
            $table->integer('qta')->nullable();
            $table->bigInteger('listino_prezzi_id')->unsigned()->nullable();
            $table->foreign('listino_prezzi_id')->references('id')->on('listino_prezzi');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('fatturazione', function (Blueprint $table) {
            $table->dropColumn('qta');
            $table->dropForeign(['listino_prezzi_id']);
            $table->dropColumn('listino_prezzi_id');
        });
    }
};
