-- Adding dft_mst table assign to value if 0 then only allow to select 1 assign to if 1 then allow to select 10 max assign to 
IF NOT EXISTS (
    SELECT * 
    FROM sys.columns 
    WHERE object_id = OBJECT_ID('dft_mst') 
    AND name = 'dft_mst_wo_multiple_assign'
)
BEGIN
    ALTER TABLE dft_mst
    ADD dft_mst_wo_multiple_assign varchar(1) NULL
END


DELETE	cf_label
WHERE	table_name = 'dft_mst'
AND 	column_name = 'dft_mst_wo_multiple_assign'
GO

INSERT 	cf_label (language_cd, table_name, column_name, 
		default_label,
		customize_label, 
		default_header, 
		customize_header, 
		cfr_flag, cf_label_required, audit_user, audit_date ) 
SELECT 	language_cd, 'dft_mst', 'dft_mst_wo_multiple_assign', 
		'WO Multiple Assign:', 
		'WO Multiple Assign:', 
		'WO Multiple Assign', 
		'WO Multiple Assign', 
		'0', '0', 'admin', getdate() 
FROM	cf_language 
GO

update dft_mst set dft_mst_wo_multiple_assign = '0' where dft_mst_wo_multiple_assign IS NULL
GO
