Files
trf_certest/public/userarea/sql/fixed_field_binding.sql
T
2026-09-23 15:50:03 +03:00

20 lines
875 B
SQL

-- json_node e default_source possono gia' esistere: in quel caso saltare le ADD COLUMN.
ALTER TABLE `template_fixed_mapping`
ADD COLUMN `json_node` varchar(500) DEFAULT NULL,
ADD COLUMN `default_source` enum('manual','xls','json') NOT NULL DEFAULT 'manual';
ALTER TABLE `template_fixed_mapping`
ADD COLUMN `excel_column` varchar(255) DEFAULT NULL AFTER `json_node`;
ALTER TABLE `template_fixed_mapping`
MODIFY COLUMN `default_source` enum('manual','xls','json') NOT NULL DEFAULT 'manual';
ALTER TABLE `lims_value_binding`
ADD COLUMN `binding_kind` enum('custom','fixed') NOT NULL DEFAULT 'custom' AFTER `template_id`,
MODIFY COLUMN `field_id` int(11) NOT NULL DEFAULT 0;
ALTER TABLE `lims_value_binding` DROP INDEX `uq_mapping_source`;
ALTER TABLE `lims_value_binding`
ADD UNIQUE KEY `uq_kind_mapping_source` (`binding_kind`, `mapping_id`, `source_key`);