<?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('users_torrents', function (Blueprint $table) {
            $table->increments('id');
            $table->uuid('uuid')->unique('uuid');
            $table->datetime('created_at');
            $table->uuid('created_uuid')->index('created_uuid');
            $table->datetime('updated_at');
            $table->uuid('updated_uuid')->index('updated_uuid');
            $table->string('infohash')->index('infohash');
            $table->string('name', 500);
            $table->string('filename', 500);
            $table->bigInteger('size');
            $table->integer('seeder')->default(0);
            $table->integer('leecher')->default(0);
            $table->integer('finished')->default(0);
        });
    }

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