IF NOT EXISTS (
    SELECT * 
    FROM sys.columns 
    WHERE object_id = OBJECT_ID('dft_mst') 
    AND name = 'dft_mst_ldap_auth_mbl'
)
BEGIN
    ALTER TABLE dft_mst
    ADD dft_mst_ldap_auth_mbl varchar(1) NULL
END


DELETE	cf_label
WHERE	table_name = 'dft_mst'
AND 	column_name = 'dft_mst_ldap_auth_mbl'
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_ldap_auth_mbl', 
		'Mobile LDAP Authentication:', 
		'Mobile LDAP Authentication:', 
		'Mobile LDAP Authentication', 
		'Mobile LDAP Authentication', 
		'0', '0', 'admin', getdate() 
FROM	cf_language 
GO

Update dft_mst Set dft_mst_ldap_auth_mbl = '0' where dft_mst_ldap_auth_mbl IS NULL
GO


IF NOT EXISTS (
    SELECT * 
    FROM sys.columns 
    WHERE object_id = OBJECT_ID('dft_mst') 
    AND name = 'dft_mst_ldap_dft_tmpl_cd_mbl'
)
BEGIN
    ALTER TABLE dft_mst
    ADD dft_mst_ldap_dft_tmpl_cd_mbl varchar(25) NULL
END


DELETE	cf_label
WHERE	table_name = 'dft_mst'
AND 	column_name = 'dft_mst_ldap_dft_tmpl_cd_mbl'
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_ldap_dft_tmpl_cd_mbl', 
		'Default LDAP Template (Mobile):', 
		'Default LDAP Template (Mobile):', 
		'Default LDAP Template (Mobile)', 
		'Default LDAP Template (Mobile)', 
		'0', '0', 'admin', getdate() 
FROM	cf_language 
GO


IF NOT EXISTS (
    SELECT * 
    FROM sys.columns 
    WHERE object_id = OBJECT_ID('dft_mst') 
    AND name = 'dft_mst_ldap_dft_usr_grp_mbl'
)
BEGIN
    ALTER TABLE dft_mst
    ADD dft_mst_ldap_dft_usr_grp_mbl varchar(5) NULL
END


DELETE	cf_label
WHERE	table_name = 'dft_mst'
AND 	column_name = 'dft_mst_ldap_dft_usr_grp_mbl'
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_ldap_dft_usr_grp_mbl', 
		'Default LDAP User Group (Mobile):', 
		'Default LDAP User Group (Mobile):', 
		'Default LDAP User Group (Mobile)', 
		'Default LDAP User Group (Mobile)', 
		'0', '0', 'admin', getdate() 
FROM	cf_language 
GO