CREATE TABLE [dbo].[ATPendingWorkItemReference] (
    [Id] INT IDENTITY(1,1) NOT NULL,
    [PendingWorkItemReferenceId] INT NOT NULL,
    [ExpirationTime] DATETIME NOT NULL,
    [CreatedTime] DATETIME NOT NULL DEFAULT GETUTCDATE(),

    CONSTRAINT [PK_ATPendingWorkItemReference] 
        PRIMARY KEY CLUSTERED ([Id]),

    CONSTRAINT [UQ_ATPendingWorkItemReference_WorkItemReferenceId]
        UNIQUE ([PendingWorkItemReferenceId]),

    CONSTRAINT [FK_ATPendingWorkItemReference_WorkItemReference]
        FOREIGN KEY ([PendingWorkItemReferenceId])
        REFERENCES [dbo].[ATWorkItemReference] ([WorkItemReferenceId])
);
