
--Migration_RCCP_20240802_101508.txt
CREATE TABLE [dbo].[PlannedAreas] (
    [Id] [uniqueidentifier] NOT NULL DEFAULT newsequentialid(),
    [PlannedSiteId] [uniqueidentifier] NOT NULL,
    [Name] [nvarchar](max),
    [Code] [nvarchar](max),
    [Type] [int] NOT NULL,
    CONSTRAINT [PK_dbo.PlannedAreas] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[PlannedDevices] (
    [Id] [uniqueidentifier] NOT NULL DEFAULT newsequentialid(),
    [PlannedSiteId] [uniqueidentifier] NOT NULL,
    [CompanySerial] [nvarchar](max),
    [Type] [nvarchar](max),
    CONSTRAINT [PK_dbo.PlannedDevices] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[PlannedDevicePlots] (
    [Id] [uniqueidentifier] NOT NULL DEFAULT newsequentialid(),
    [DeviceName] [nvarchar](max),
    [CameraLensType] [int] NOT NULL,
    [MountingHeight] [float] NOT NULL,
    [DeviceUsage] [int] NOT NULL,
    [FloorplanID] [uniqueidentifier] NOT NULL,
    [PlannedDeviceId] [uniqueidentifier] NOT NULL,
    [RotateDegree] [float] NOT NULL,
    CONSTRAINT [PK_dbo.PlannedDevicePlots] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[PlannedFloorPlans] (
    [Id] [uniqueidentifier] NOT NULL DEFAULT newsequentialid(),
    [Name] [nvarchar](max),
    [FileLocation] [nvarchar](max),
    [ActualDistance] [bigint] NOT NULL,
    [FloorplanScaleValue] [bigint] NOT NULL,
    [FloorplanData] [nvarchar](max),
    [CurrentDeviceID] [nvarchar](max),
    [CanvasBaseWidth] [bigint] NOT NULL,
    [UserId] [bigint] NOT NULL,
    [EntityTypeId] [bigint] NOT NULL,
    [EntityType] [int] NOT NULL,
    [ExistenceType] [int] NOT NULL,
    [PlannedSiteId] [uniqueidentifier] NOT NULL,
    CONSTRAINT [PK_dbo.PlannedFloorPlans] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[PlannedSites] (
    [Id] [uniqueidentifier] NOT NULL DEFAULT newsequentialid(),
    [Code] [nvarchar](max),
    [Name] [nvarchar](max),
    [Latitude] [float] NOT NULL,
    [Longitude] [float] NOT NULL,
    CONSTRAINT [PK_dbo.PlannedSites] PRIMARY KEY ([Id])
)
