-- Reversa de 2026-10-28_02_enlaces_adjuntos_cotizacion.sql (borra los enlaces registrados)
USE tinsa_db;

DELETE FROM cotizacion_venta_adjunto WHERE tipo = 'enlace';
ALTER TABLE cotizacion_venta_adjunto
  DROP COLUMN url,
  MODIFY archivo VARCHAR(255) NOT NULL,
  MODIFY tipo ENUM('imagen','documento','cad','otro') NOT NULL DEFAULT 'documento';

DELETE FROM cotizacion_venta_oferta_documento WHERE tipo = 'enlace';
ALTER TABLE cotizacion_venta_oferta_documento
  DROP COLUMN url,
  MODIFY archivo VARCHAR(255) NOT NULL,
  MODIFY tipo ENUM('imagen','documento','cad','otro') NOT NULL DEFAULT 'documento';
