<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('records_rows', function (Blueprint $table) {
            $table->decimal('aliquota_iva', 8, 2)->nullable()->after('amount');
            $table->decimal('imponibile', 8, 2)->nullable()->after('aliquota_iva');
            $table->decimal('imposta', 8, 2)->nullable()->after('imponibile');
            $table->string('divisa', 10)->nullable()->after('imposta');
            $table->integer('numero_linea')->nullable()->after('divisa');
            $table->decimal('prezzo_unitario', 10, 2)->nullable()->after('numero_linea');
            $table->decimal('quantita', 10, 2)->nullable()->after('prezzo_unitario');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('records_rows', function (Blueprint $table) {
            $table->dropColumn([
                'aliquota_iva',
                'imponibile',
                'imposta',
                'divisa',
                'numero_linea',
                'prezzo_unitario',
                'quantita'
            ]);
        });
    }
};
