<?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('tracks', function (Blueprint $table) {
    	        $table->id();
            	$table->string('file_path', 255);
    		$table->string('title', 255);
    		$table->integer('duration_seconds')->nullable();
    		$table->foreignId('album_id')->nullable()->constrained('albums');
		$table->timestamps();
        });
    }

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