<?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('ticket', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('t_id')->nullable();
            $table->string('image1')->nullable();
            $table->string('nameteam1')->nullable();
            $table->string('image2')->nullable();
            $table->string('nameteam2')->nullable();
            $table->date('date')->nullable();
            $table->time('time')->nullable();
            $table->string('stadium')->nullable();
            $table->timestamps();

            $table->foreign('t_id')->references('id')->on('users')->onDelete('set null');


        });
    }

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