<?php


// Migration (Schema): database/migrations/2025_09_10_000001_create_car_colors_table.php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;


class CreateCarColorsTable extends Migration
{
public function up()
{
Schema::create('car_colors', function (Blueprint $table) {
$table->id();
$table->string('color_name', 50);
$table->enum('category', ['Neutra', 'Colorida'])->default('Neutra');
$table->enum('finish', ['Sólida', 'Metálica', 'Perolizada', 'Fosca'])->default('Sólida');
$table->decimal('popularity_percentage', 5, 2)->nullable();
$table->timestamps();


$table->unique(['color_name', 'finish']);
});
}


public function down()
{
Schema::dropIfExists('car_colors');
}
}