<?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::create('configuration', function (Blueprint $table) {
            $table->id();
            $table->string('logo')->nullable();
            $table->string('name')->nullable();
            $table->string('address')->nullable();
            $table->string('countrry')->nullable();
            $table->string('province')->nullable();
            $table->string('fiscal_code')->nullable();
            $table->string('vat')->nullable();
            $table->integer('fiscal_year_month_from')->defaulut(1);
            $table->integer('fiscal_year_month_to')->default(12);
            $table->unsignedBigInteger('subscription_causal_id')->nullable();
            $table->foreign('subscription_causal_id')->nullable()->references('id')->on('causals')->onUpdate('cascade')->onDelete('cascade');
            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('configuration');
    }
};
