
-- ADD one more column  sys_ver_apk_url
--Select * from sys_ver (NOLOCK)

Alter table sys_ver  ADD sys_ver_apk_url varchar(200);
----------------------------------------------------------------------------------------------

--Select * from tkn_mst (NOLOCK)

--ADD New Table tkn_mst
CREATE TABLE [dbo].[tkn_mst](
	[tkn_dvc_id] [varchar](50) NULL,
	[tkn_brand] [varchar](50) NULL,
	[tkn_model] [varchar](50) NULL,
	[tkn_token] [varchar](300) NULL,
	[tkn_user] [varchar](50) NULL,
	[tkn_site] [varchar](4) NULL,
	[tkn_login] [datetime] NULL,
	[tkn_logout] [datetime] NULL,
	[tkn_online] [varchar](1) NULL,
	[RowID] [numeric](12, 0) IDENTITY(1,1) NOT NULL
) ON [PRIMARY]

GO
----------------------------------------------------------------------------------------------
--For Acknowledgement rating we adding this columns
--Select * from wko_det (NOLOCK)

alter table wko_det
add wko_det_rating1 numeric(21,4) null

alter table wko_det
add wko_det_rating2 numeric(21,4) null

alter table wko_det
add wko_det_rating3 numeric(21,4) null

alter table wko_det
add wko_det_ack_name varchar (60) null

alter table wko_det
add wko_det_ack_id varchar (60) null

alter table wko_det
add wko_det_ack_contact varchar (20) null

alter table wko_det
add wko_det_ack_date datetime null

--After Creat the column next steps 

DELETE	cf_label
WHERE	table_name = 'wko_det'
AND 	column_name = 'wko_det_rating1'
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, 'wko_det', 'wko_det_rating1', 
		'Rating 1:', 
		'Rating 1:', 
		'Rating 1', 
		'Rating 1', 
		'0', '0', 'admin', getdate() 
FROM	cf_language 
GO

DELETE	cf_label
WHERE	table_name = 'wko_det'
AND 	column_name = 'wko_det_rating2'
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, 'wko_det', 'wko_det_rating2', 
		'Rating 2:', 
		'Rating 2:', 
		'Rating 2', 
		'Rating 2', 
		'0', '0', 'admin', getdate() 
FROM	cf_language 
GO

DELETE	cf_label
WHERE	table_name = 'wko_det'
AND 	column_name = 'wko_det_rating3'
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, 'wko_det', 'wko_det_rating3', 
		'Rating 3:', 
		'Rating 3:', 
		'Rating 3', 
		'Rating 3', 
		'0', '0', 'admin', getdate() 
FROM	cf_language 
GO

DELETE	cf_label
WHERE	table_name = 'wko_det'
AND 	column_name = 'wko_det_ack_name'
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, 'wko_det', 'wko_det_ack_name', 
		'Acknowledge By:', 
		'Acknowledge By:', 
		'Acknowledge By', 
		'Acknowledge By', 
		'0', '0', 'admin', getdate() 
FROM	cf_language 
GO

DELETE	cf_label
WHERE	table_name = 'wko_det'
AND 	column_name = 'wko_det_ack_id'
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, 'wko_det', 'wko_det_ack_id', 
		'Acknowledge ID:', 
		'Acknowledge ID:', 
		'Acknowledge ID', 
		'Acknowledge ID', 
		'0', '0', 'admin', getdate() 
FROM	cf_language 
GO

DELETE	cf_label
WHERE	table_name = 'wko_det'
AND 	column_name = 'wko_det_ack_contact'
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, 'wko_det', 'wko_det_ack_contact', 
		'Contact:', 
		'Contact:', 
		'Contact', 
		'Contact', 
		'0', '0', 'admin', getdate() 
FROM	cf_language 
GO


DELETE	cf_label
WHERE	table_name = 'wko_det'
AND 	column_name = 'wko_det_ack_date'
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, 'wko_det', 'wko_det_ack_date', 
		'Acknowledge Date:', 
		'Date:', 
		'Acknowledge Date', 
		'Date', 
		'0', '0', 'admin', getdate() 
FROM	cf_language 
GO
-------------------------------------------------------------------------------------------------------
--Select * from wko_det (NOLOCK)

Alter table wko_det
add wko_det_rea_rmk varchar (255) null

DELETE	cf_label
WHERE	table_name = 'wko_det'
AND 	column_name = 'wko_det_rea_rmk'
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, 'wko_det', 'wko_det_rea_rmk', 
		'Reassign Remarks:', 
		'Reassign Remarks:', 
		'Reassign Remarks', 
		'Reassign Remarks', 
		'0', '0', 'admin', getdate() 
FROM	cf_language 
GO


-------------------------------------------------------------------------------------------------------

--Select * from wko_ls7 (NOLOCK)

--Add date on wko_ls7
ALTER TABLE	wko_ls7
ADD			wko_ls7_date1 DATETIME,
			wko_ls7_date2 DATETIME,
			wko_ls7_date3 DATETIME,
			wko_ls7_date4 DATETIME,
			wko_ls7_date5 DATETIME
GO

DELETE	cf_label
WHERE	table_name = 'wko_ls7'
AND 	column_name = 'wko_ls7_date1'
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, 'wko_ls7', 'wko_ls7_date1', 
		'UDF Date 1:', 
		'UDF Date 1:', 
		'UDF Date 1', 
		'UDF Date 1', 
		'0', '0', 'admin', getdate() 
FROM	cf_language 
GO

DELETE	cf_label
WHERE	table_name = 'wko_ls7'
AND 	column_name = 'wko_ls7_date2'
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, 'wko_ls7', 'wko_ls7_date2', 
		'UDF Date 2:', 
		'UDF Date 2:', 
		'UDF Date 2', 
		'UDF Date 2', 
		'0', '0', 'admin', getdate() 
FROM	cf_language 
GO

DELETE	cf_label
WHERE	table_name = 'wko_ls7'
AND 	column_name = 'wko_ls7_date3'
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, 'wko_ls7', 'wko_ls7_date3', 
		'UDF Date 3:', 
		'UDF Date 3:', 
		'UDF Date 3', 
		'UDF Date 3', 
		'0', '0', 'admin', getdate() 
FROM	cf_language 
GO

DELETE	cf_label
WHERE	table_name = 'wko_ls7'
AND 	column_name = 'wko_ls7_date4'
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, 'wko_ls7', 'wko_ls7_date4', 
		'UDF Date 4:', 
		'UDF Date 4:', 
		'UDF Date 4', 
		'UDF Date 4', 
		'0', '0', 'admin', getdate() 
FROM	cf_language 
GO

DELETE	cf_label
WHERE	table_name = 'wko_ls7'
AND 	column_name = 'wko_ls7_date5'
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, 'wko_ls7', 'wko_ls7_date5', 
		'UDF Date 5:', 
		'UDF Date 5:', 
		'UDF Date 5', 
		'UDF Date 5', 
		'0', '0', 'admin', getdate() 
FROM	cf_language 
GO
--------------------------------------------------------------------------------------------------------
--Select * from ntf_log_send (NOLOCK)
--CREATE Notification log
CREATE TABLE [dbo].[ntf_log_send](
	[site_cd] [varchar](4) NOT NULL,
	[mst_RowID] [numeric](12, 0),
	[ntf_log_send_curr_site] [varchar](4) NULL,
	[ntf_log_send_tkn_id] [varchar](300) NULL,
	[tkn_rowid] [numeric](12, 0),
	[ntf_log_send_status] [varchar](1) NULL, 
	[ntf_log_send_error] [varchar](2000) NULL,
	[audit_user] [varchar](50) NOT NULL,
	[audit_date] [datetime] NOT NULL,
	[column1] [varchar](60) NULL,
	[column2] [varchar](60) NULL,
	[column3] [varchar](60) NULL,
	[column4] [varchar](60) NULL,
	[column5] [varchar](60) NULL,
	[RowID] [numeric](12, 0) IDENTITY(1,1) NOT NULL
)
------------------------------------------------------------------------------------------------------------

--select  * from wrk_sts

alter table wrk_sts add wrk_sts_tim_crd varchar(1) NULL
GO

update wrk_sts set wrk_sts_tim_crd = '0'
GO
 

DELETE cf_label

WHERE  table_name = 'wrk_sts'

AND    column_name = 'wrk_sts_tim_crd'

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, 'wrk_sts', 'wrk_sts_tim_crd',

              'Timecard Require:',

              'Timecard Require:',

              'Timecard Require',

              'Timecard Require',

              '0', '0', 'admin', getdate()

FROM   cf_language

GO
------------------------------------------------------------------------------------------------


SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[ntf_log](
	[site_cd] [varchar](4) NOT NULL,
	[ntf_log_from] [varchar](55) NULL,
	[ntf_log_to] [varchar](50) NULL,
	[ntf_log_doc_no] [varchar](20) NULL,
	[ntf_log_title] [varchar](100) NULL,
	[ntf_log_body] [varchar](200) NULL,
	[ntf_log_msg] [varchar](1000) NULL,
	[ntf_log_priority] [varchar](20) NULL,
	[ntf_log_icon] [varchar](30) NULL,
	[ntf_log_sound] [varchar](30) NULL,
	[ntf_log_event] [varchar](30) NULL,
	[ntf_log_module] [varchar](30) NULL,
	[ntf_log_send] [varchar](1) NOT NULL,
	[ntf_log_send_date] [datetime] NULL,
	[ntf_log_rcv] [varchar](1) NOT NULL,
	[ntf_log_rcv_dvc_id] [varchar](50) NULL,
	[ntf_log_rcv_date] [datetime] NULL,
	[audit_user] [varchar](50) NOT NULL,
	[audit_date] [datetime] NOT NULL,
	[column1] [varchar](60) NULL,
	[column2] [varchar](60) NULL,
	[column3] [varchar](60) NULL,
	[column4] [varchar](60) NULL,
	[column5] [varchar](60) NULL,
	[RowID] [numeric](12, 0) IDENTITY(1,1) NOT NULL
) ON [PRIMARY]
GO