32 lines
941 B
PHP
32 lines
941 B
PHP
<?php
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
return new class extends Migration
|
|
{
|
|
public function up(): void
|
|
{
|
|
Schema::create('cars', function (Blueprint $table) {
|
|
$table->id();
|
|
$table->string('brand');
|
|
$table->string('model');
|
|
$table->string('year');
|
|
$table->string('license_plate')->unique();
|
|
$table->string('color');
|
|
$table->decimal('daily_rate', 10, 2);
|
|
$table->enum('status', ['available', 'rented', 'maintenance', 'sold'])->default('available');
|
|
$table->string('image')->nullable();
|
|
$table->integer('mileage')->default(0);
|
|
$table->text('notes')->nullable();
|
|
$table->timestamps();
|
|
});
|
|
}
|
|
|
|
public function down(): void
|
|
{
|
|
Schema::dropIfExists('cars');
|
|
}
|
|
};
|