UPDATE TBDD_MODULES SET DB_VERSION = '2.2.1.5' where NAME = 'Process-Manager'
GO
CREATE TABLE TBPM_CONTOL_TABLE_LANG
(
	GUID           			BIGINT		IDENTITY(1,1),
	COL_ID					INTEGER		NOT NULL,
	CAPTION					VARCHAR(250)	NOT NULL,
	LANG_CODE				VARCHAR(5)	NOT NULL,
	ADDED_WHO				VARCHAR(100)		DEFAULT 'SYSTEM'	NOT NULL,
	ADDED_WHEN				DATETIME 		DEFAULT GETDATE(),
	CHANGED_WHO				VARCHAR(100),
	CHANGED_WHEN			DATETIME,
	CONSTRAINT	PK_TBPM_CONTOL_TABLE_LANG PRIMARY KEY(GUID),
	CONSTRAINT	FK_TBPM_CONTOL_TABLE_LANG_COLID FOREIGN KEY (COL_ID)  REFERENCES  TBPM_CONTROL_TABLE (GUID)
)
GO
CREATE TRIGGER TBPM_CONTOL_TABLE_LANG_AFT_UPD ON TBPM_CONTOL_TABLE_LANG
FOR UPDATE
AS
  UPDATE TBPM_CONTOL_TABLE_LANG SET CHANGED_WHEN = GETDATE()
  FROM INSERTED
  WHERE TBPM_CONTOL_TABLE_LANG.GUID = INSERTED.GUID
GO