UPDATE TBDD_MODULES SET DB_VERSION = '1.1.0.3' WHERE SHORT_NAME = 'SIG_ENV_CR'
GO


ALTER TABLE [dbo].[TBSIG_EMAIL_TEMPLATE] ADD [ADDED_WHEN] DATETIME NOT NULL DEFAULT GETDATE();
ALTER TABLE [dbo].[TBSIG_EMAIL_TEMPLATE] ADD [CHANGED_WHEN] DATETIME ;
GO

CREATE TRIGGER [dbo].[TBSIG_EMAIL_TEMPLATE_AFT_UPD] ON [dbo].[TBSIG_EMAIL_TEMPLATE]
FOR UPDATE
AS
	UPDATE TBSIG_EMAIL_TEMPLATE SET CHANGED_WHEN = GETDATE() FROM INSERTED WHERE TBSIG_EMAIL_TEMPLATE.GUID = INSERTED.GUID
GO
ALTER TABLE [dbo].[TBSIG_CONFIG] ADD [ADDED_WHEN] DATETIME NOT NULL DEFAULT GETDATE();
ALTER TABLE [dbo].[TBSIG_CONFIG] ADD [CHANGED_WHEN] DATETIME ;
ALTER TABLE [dbo].[TBSIG_CONFIG] ADD [GUID] TINYINT NOT NULL DEFAULT 1;
GO
CREATE TRIGGER [dbo].[TBSIG_CONFIG_AFT_UPD] ON [dbo].[TBSIG_CONFIG]
FOR UPDATE
AS
	UPDATE TBSIG_CONFIG SET CHANGED_WHEN = GETDATE() FROM INSERTED WHERE TBSIG_CONFIG.GUID = 1
GO