<?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::create('saltacoda_ordine', function (Blueprint $table) {
            $table->id();
            $table->string('riferimento')->nullable();
            $table->bigInteger('prenotazione_id')->unsigned()->nullable();
            $table->string('stato');
            // $table->bigInteger('dispositivo_id')->unsigned()->nullable();
            $table->bigInteger('pagamento_id')->unsigned()->nullable();
            $table->bigInteger('attivita_id')->unsigned()->nullable();
            $table->string('note')->nullable();
            $table->string('codice')->unique()->nullable();
            $table->string('tipo')->nullable();
            $table->decimal('prezzo', 10, 2)->nullable();
            $table->bigInteger('metodo_pagamento_id')->unsigned()->nullable();
            $table->json('info')->nullable();
            $table->timestamps();
        });
    }

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