CREATE TABLE [dbo].[DashboardDevicesUngrouped]
(
[ID] [int] NOT NULL IDENTITY(1, 1),
[AccountID] [int] NOT NULL,
[DeviceID] [int] NOT NULL,
[AuditDate] [datetime] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[DashboardDevicesUngrouped] ADD CONSTRAINT [PK_DashboardDevicesUngrouped_ID] PRIMARY KEY CLUSTERED ([ID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[DashboardDevicesUngrouped] ADD CONSTRAINT [FK_DashboardDevicesUngrouped_AccountID_Account_AccountID] FOREIGN KEY ([AccountID]) REFERENCES [dbo].[Account] ([AccountID]) ON DELETE CASCADE
GO