UPDATE TBDD_MODULES SET DB_VERSION = '1.1' where SHORT_NAME = 'MWF';
GO

ALTER TABLE TBMWF_PROFILE ADD [PRIORITY] INTEGER NOT NULL DEFAULT 0
GO
ALTER TABLE TBMWF_TF_FILES ADD [ProcessID] INTEGER NOT NULL DEFAULT 0
GO
ALTER TABLE TBMWF_PROF_BUTTONS ADD [NextDialogID] TINYINT NOT NULL DEFAULT 0
GO
ALTER TABLE TBMWF_PROF_CONTROLS_TF ADD [NextDialogID] TINYINT NOT NULL DEFAULT 0
GO
ALTER TABLE TBMWF_PROF_CONTROLS_TF ADD [TYPE] NVARCHAR(50) NOT NULL DEFAULT 'TEXT'
GO
ALTER TABLE TBMWF_PROF_CONTROLS_TF ADD [VALUES] NVARCHAR(900)
GO
ALTER TABLE TBMWF_PROF_CONTROLS_TF ADD [PROCESSID] INTEGER NOT NULL DEFAULT 0
EXEC sp_RENAME 'TBMWF_PROF_CONTROLS_TF.SEQU' , 'SEQUENCE', 'COLUMN'
GO
CREATE VIEW VWMWF_F19_PROFILE AS
SELECT 
	GUID AS ID,
	[INTL_NAME] As Title,
	PRIORITY
FROM
	TBMWF_PROFILE
GO
CREATE VIEW VWMWF_F19_FIELD AS
SELECT
	GUID AS ID,
	PROCESSID,
	DIALOG_NO AS DIALOGID,
	ATTR_NAME AS [NAME],
	CAPTION AS TITLE,
	[TYPE],
	[VALUES],
	[READ_ONLY] as [READONLY],
	SEQUENCE as ORDER_KEY
FROM
	TBMWF_PROF_CONTROLS_TF FIELD
GO
CREATE VIEW VWMWF_F19_BUTTON AS
SELECT
	GUID AS ID,
	MWF_PROFILE_ID as ProfileID,
	DIALOG_NO AS DIALOGID,
	NextDialogID AS NextDialogID,
	TEXT AS title,
	FORE_COLOR as forecolor,
	BACK_COLOR as backcolor
FROM
	TBMWF_PROF_BUTTONS FIELD
