CREATE TABLE [dbo].[ContainerHistory]
(
[ContainerHistoryID] [int] NOT NULL IDENTITY(1, 1),
[ContainerFID] [int] NOT NULL,
[OrderFID] [int] NULL,
[ActivityDescription] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[OldValue] [varchar] (256) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[NewValue] [varchar] (256) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[SysuserFID] [int] NOT NULL,
[DateEntered] [datetime] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ContainerHistory] ADD CONSTRAINT [PK_ContainerHistory] PRIMARY KEY NONCLUSTERED ([ContainerHistoryID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ContainerHistory] ADD CONSTRAINT [FK_ContainerHistory_Container] FOREIGN KEY ([ContainerFID]) REFERENCES [dbo].[Container] ([ContainerID]) ON DELETE CASCADE
GO
ALTER TABLE [dbo].[ContainerHistory] ADD CONSTRAINT [FK_ContainerHistory_Order] FOREIGN KEY ([OrderFID]) REFERENCES [dbo].[Orders] ([PriKey])
GO
ALTER TABLE [dbo].[ContainerHistory] ADD CONSTRAINT [FK_ContainerHistory_SysUser] FOREIGN KEY ([SysuserFID]) REFERENCES [dbo].[Sysuser] ([SysUserID])
GO
GRANT SELECT ON [dbo].[ContainerHistory] TO [MssExec]
GRANT INSERT ON [dbo].[ContainerHistory] TO [MssExec]
GRANT DELETE ON [dbo].[ContainerHistory] TO [MssExec]
GRANT UPDATE ON [dbo].[ContainerHistory] TO [MssExec]
GO