
--Migration_RCCP_20251111_140137.txt
CREATE TABLE [dbo].[AnchorPointsCollections] (
    [Id] [bigint] NOT NULL IDENTITY,
    [FloorplanId] [bigint] NOT NULL,
    [UserId] [bigint],
    [CreatedUTCDateTime] [datetime] NOT NULL,
    [LastUpdatedUTCDateTime] [datetime] NOT NULL,
    [AnchorPairs] [nvarchar](max),
    [AnchorType] [nvarchar](max),
    CONSTRAINT [PK_dbo.AnchorPointsCollections] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[CompanyCubeSchemaLogs] (
    [Id] [bigint] NOT NULL IDENTITY,
    [CubeId] [bigint] NOT NULL,
    [CubeName] [nvarchar](max),
    [SqlStatement] [nvarchar](max),
    [Dimensions] [nvarchar](max),
    [Measures] [nvarchar](max),
    [CreatedDateTime] [datetime] NOT NULL,
    [CompanyId] [bigint] NOT NULL,
    [Action] [nvarchar](max),
    CONSTRAINT [PK_dbo.CompanyCubeSchemaLogs] PRIMARY KEY ([Id])
)
ALTER TABLE [dbo].[CompanyCubeSchemas] ADD [UpdatedDateTime] [datetime] NOT NULL DEFAULT '1900-01-01T00:00:00.000'
ALTER TABLE [dbo].[PathLinkingParameters] ADD [FloorplanId] [bigint]
ALTER TABLE [dbo].[PathLinkingParameters] ADD [UserId] [bigint]
ALTER TABLE [dbo].[PlannedSiteImages] ADD [Name] [nvarchar](max)
DECLARE @var0 nvarchar(128)
SELECT @var0 = name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.CompanyCubeSchemaVersions')
AND col_name(parent_object_id, parent_column_id) = 'SchemaId';
IF @var0 IS NOT NULL
    EXECUTE('ALTER TABLE [dbo].[CompanyCubeSchemaVersions] DROP CONSTRAINT [' + @var0 + ']')
ALTER TABLE [dbo].[CompanyCubeSchemaVersions] DROP COLUMN [SchemaId]
