
--Migration_RCCP_20250801_085553.txt
CREATE TABLE [dbo].[AreaDataConfigurationLinks] (
    [Id] [bigint] NOT NULL IDENTITY,
    [AreaId] [bigint] NOT NULL,
    [DataConfigurationId] [bigint] NOT NULL,
    CONSTRAINT [PK_dbo.AreaDataConfigurationLinks] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[AreaDevicePlotLinks] (
    [ID] [bigint] NOT NULL IDENTITY,
    [AreaPlotId] [bigint] NOT NULL,
    [DevicePlotId] [bigint] NOT NULL,
    CONSTRAINT [PK_dbo.AreaDevicePlotLinks] PRIMARY KEY ([ID])
)
CREATE TABLE [dbo].[DataConfigurations] (
    [Id] [bigint] NOT NULL IDENTITY,
    [Name] [nvarchar](max),
    [CompanyId] [bigint] NOT NULL,
    [MetricId] [int] NOT NULL,
    CONSTRAINT [PK_dbo.DataConfigurations] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[DataConfigurationDataIdLinks] (
    [Id] [bigint] NOT NULL IDENTITY,
    [DataConfigurationId] [bigint] NOT NULL,
    [DataId] [bigint] NOT NULL,
    CONSTRAINT [PK_dbo.DataConfigurationDataIdLinks] PRIMARY KEY ([Id])
)
DROP TABLE [dbo].[AreaDatasetConfigurations]
DROP TABLE [dbo].[CCTVs]
DROP TABLE [dbo].[MasterLinkedDevices]
