UPDATE TBDD_MODULES SET PRODUCT_VERSION = '2.4.4.7' where NAME = 'Record-Organizer' 
GO
ALTER TABLE TBPMO_FORM_CONSTRUCTOR_DETAIL
ADD CONTROL_DOCTYPE_MATCH INTEGER NOT NULL DEFAULT '0'
GO
ALTER TABLE TBPMO_FORM_CONSTRUCTOR_DETAIL
ADD SQL_RIGHT_READ_AND_VIEW_ONLY VARCHAR(5000) NOT NULL DEFAULT ''
GO
ALTER TABLE TBPMO_FORM_CONSTRUCTOR_DETAIL
ADD SQL_QUICK_VIEW VARCHAR(MAX) NOT NULL DEFAULT ''
GO
ALTER TABLE TBPMO_FORM_CONSTRUCTOR_DETAIL
ADD LOAD_DIRECT BIT NOT NULL DEFAULT 0
GO
ALTER VIEW VWPMO_CONSTRUCTOR_FORMS AS
SELECT TOP 100 PERCENT
	T2.GUID,
	T1.GUID FORM_VIEW_ID,
	T1.SCREEN_ID,
	T2.CONSTRUCT_ID,
	T.PARENT_ID,
	T2.SEQUENCE,
	T2.LEVEL1_SELECT,
	T.GUID			AS FORM_ID, 
	T1.FORM_TITLE, 
	T2.SQL_SELECT_EBENE1,
	T2.SQL_SELECT_EBENE2,
	T2.SQL_QUICK_VIEW,
	T2.COLUMN_NAME1,
	T2.COLUMN_NAME2,
	T.FORM_TYPE_ID,
	T2.LOAD_DIRECT,
	T2.CONTROL_DOCTYPE_MATCH,
	T2.SQL_RIGHT_READ_AND_VIEW_ONLY
FROM 
	tbpmo_form T, 
	TBPMO_FORM_VIEW T1,
	TBPMO_FORM_CONSTRUCTOR_DETAIL T2 
where 
	T2.FORM_ID = T.GUID AND
	T.GUID = T1.FORM_ID 
ORDER BY 
	T2.CONSTRUCT_ID,T.PARENT_ID,T2.SEQUENCE
GO
ALTER TABLE TBPMO_RECORD
ADD IN_WORK BIT NOT NULL DEFAULT 0
GO
ALTER TABLE TBPMO_RECORD
ADD IN_WORK_WHO VARCHAR(100)
GO


