unsignedBigInteger('id')->autoIncrement(); $table->enum('status', ['active', 'sold', 'draft'])->default('active'); $table->enum('condition', ['new', 'used'])->default('used'); $table->string('make', 64); $table->string('model', 64); $table->string('generation', 64)->nullable(); $table->smallInteger('year')->unsigned(); $table->string('vin', 17)->nullable(); $table->string('plate', 20)->nullable(); $table->string('body_type', 32)->nullable(); $table->tinyInteger('doors')->unsigned()->nullable(); $table->string('color_exterior', 32)->nullable(); $table->string('color_interior', 32)->nullable(); $table->enum('engine_type', ['petrol', 'diesel', 'hybrid', 'electric', 'gas', 'other'])->nullable(); $table->decimal('engine_volume', 3, 1)->nullable(); $table->smallInteger('engine_power_hp')->unsigned()->nullable(); $table->enum('transmission', ['manual', 'automatic', 'robot', 'variator', 'electric'])->nullable(); $table->enum('drive', ['FWD', 'RWD', 'AWD', '4WD'])->nullable(); $table->unsignedInteger('mileage_km')->nullable(); $table->enum('steering', ['left', 'right'])->default('left'); $table->tinyInteger('owners_count')->unsigned()->nullable(); $table->boolean('customs_cleared')->default(true); $table->enum('pts', ['original', 'duplicate', 'electronic'])->nullable(); $table->boolean('accident_free')->default(false); $table->unsignedInteger('price_usd')->nullable(); $table->unsignedBigInteger('price_rub')->nullable(); $table->unsignedBigInteger('price_vladivostok')->nullable(); $table->unsignedBigInteger('price_moscow')->nullable(); $table->boolean('price_negotiable')->default(false); $table->string('country_origin', 64)->nullable(); $table->string('city', 64)->nullable(); $table->text('options')->nullable(); $table->string('title', 128)->nullable(); $table->text('description')->nullable(); $table->string('photo_main', 512)->nullable(); $table->text('photos_gallery')->nullable()->comment('JSON array of paths'); $table->timestamps(); $table->index(['make', 'model'], 'idx_make_model'); $table->index('year', 'idx_year'); $table->index('status', 'idx_status'); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('cars'); } };