-- Documents related to service orders
CREATE TABLE IF NOT EXISTS service_documents (
  id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
  order_id BIGINT UNSIGNED NOT NULL,
  tipo VARCHAR(80) NULL,
  titulo VARCHAR(190) NULL,
  arquivo_nome VARCHAR(190) NULL,
  storage_path VARCHAR(255) NULL,
  url VARCHAR(255) NULL,
  created_at TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
  INDEX idx_sdoc_order (order_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;