CREATE TABLE [dbo].[ATTrackingDefinition] (
    [Id]          INT            IDENTITY(1,1) NOT NULL,
    [ProcessId]   INT            NOT NULL,
    [EventId]     INT            NOT NULL,
    [EventName]   NVARCHAR(255)  NOT NULL,
    [Enable]      NVARCHAR(1)    NOT NULL,
    EnableExternal BIT NOT NULL DEFAULT 0,
    [Description] NVARCHAR(255)  NULL,
    [Action]      NVARCHAR(255)  NULL,
    [User]        NVARCHAR(255)  NULL,
    [Message]     NVARCHAR(MAX)  NULL,
    CONSTRAINT [PK_ATTrackingDefinition] PRIMARY KEY CLUSTERED ([Id] ASC),
    CONSTRAINT [FK_ATTrackingDefinition_ATProcessDefinition] FOREIGN KEY ([ProcessId]) REFERENCES [dbo].[ATProcessDefinition] ([ProcessID]),
    CONSTRAINT [FK_ATTrackingDefinition_ATEventDefinition] FOREIGN KEY ([EventId]) REFERENCES [dbo].[ATEventDefinition] ([EventID])
);
