ALTER TABLE facturacion_integracion_endpoints
    ADD COLUMN es_defecto TINYINT(1) NOT NULL DEFAULT 0 AFTER estado;

UPDATE facturacion_integracion_endpoints
SET es_defecto = 1
WHERE codigo = 'SUNAT_FACTURA'
  AND deleted_at IS NULL
  AND estado = 1
LIMIT 1;
