Files
whatsapp/migrations/20260616_lab_form_envios_turnero.sql
2026-06-16 16:55:22 -05:00

11 lines
619 B
SQL

-- Vincula lab_form_envios con turnero_consentimientos para firma presencial
ALTER TABLE lab_form_envios
ADD COLUMN IF NOT EXISTS turnero_consentimiento_id INT UNSIGNED DEFAULT NULL
COMMENT 'FK turnero_consentimientos.id cuando es firma presencial del turnero',
ADD INDEX IF NOT EXISTS idx_fenv_tc (turnero_consentimiento_id);
-- Vinculo inverso: el consentimiento sabe cuál lab_form_envios usa para firma presencial
ALTER TABLE turnero_consentimientos
ADD COLUMN IF NOT EXISTS lab_form_envio_id INT DEFAULT NULL
COMMENT 'FK lab_form_envios.id para firma presencial via form_cliente.php';