CREATE TABLE [dbo].[MacOSPatch_DeviceConfiguration] (
    [DeviceID]               INT      NOT NULL,
    [CheckForUpdates]        BIT      NOT NULL,
    [DownloadNewUpdates]     BIT      NOT NULL,
    [InstallMacOSUpdates]    BIT      NOT NULL,
    [InstallSecurityUpdates] BIT      NOT NULL,
    [LastUpdateTime]         DATETIME NULL,
    CONSTRAINT [PK_MacOSPatch_DeviceConfiguration] PRIMARY KEY CLUSTERED ([DeviceID] ASC)
);
GO
ALTER TABLE [dbo].[MacOSPatch_DeviceConfiguration] ADD DEFAULT (getdate()) FOR [LastUpdateTime];
GO
ALTER TABLE [dbo].[MacOSPatch_DeviceConfiguration] WITH NOCHECK ADD CONSTRAINT [FK_MacOSPatch_DeviceConfiguration_Device] FOREIGN KEY ([DeviceID]) REFERENCES [dbo].[Device] ([DeviceID]) ON DELETE CASCADE ON UPDATE CASCADE;
GO
ALTER TABLE [dbo].[MacOSPatch_DeviceConfiguration] WITH CHECK CHECK CONSTRAINT [FK_MacOSPatch_DeviceConfiguration_Device];
GO