-- Vehicles table
CREATE TABLE IF NOT EXISTS vehicles (
  id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
  placa VARCHAR(10) NULL,
  chassi VARCHAR(32) NULL,
  renavam VARCHAR(20) NULL,
  marca VARCHAR(120) NULL,
  modelo VARCHAR(160) NULL,
  ano SMALLINT NULL,
  cor VARCHAR(60) NULL,
  tipo ENUM('carro','moto','pesado','outro') NOT NULL DEFAULT 'carro',
  cliente_id BIGINT UNSIGNED NULL,
  created_at TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
  updated_at TIMESTAMP NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
  INDEX idx_vehicles_placa (placa),
  INDEX idx_vehicles_cliente (cliente_id),
  INDEX idx_vehicles_tipo (tipo)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;