
--Migration_RCCP_20220908_150210.txt
EXECUTE sp_rename @objname = N'dbo.MetricDetails', @newname = N'__mig_tmp__0', @objtype = N'OBJECT'
IF object_id('[PK_dbo.MetricDetails]') IS NOT NULL BEGIN
    EXECUTE sp_rename @objname = N'[PK_dbo.MetricDetails]', @newname = N'PK_dbo.__mig_tmp__0', @objtype = N'OBJECT'
END
EXECUTE sp_rename @objname = N'dbo.MetricTables', @newname = N'MetricDetails', @objtype = N'OBJECT'
IF object_id('[PK_dbo.MetricTables]') IS NOT NULL BEGIN
    EXECUTE sp_rename @objname = N'[PK_dbo.MetricTables]', @newname = N'PK_dbo.MetricDetails', @objtype = N'OBJECT'
END
EXECUTE sp_rename @objname = N'__mig_tmp__0', @newname = N'MetricDetails1', @objtype = N'OBJECT'
IF object_id('[PK___mig_tmp__0]') IS NOT NULL BEGIN
    EXECUTE sp_rename @objname = N'[PK___mig_tmp__0]', @newname = N'PK_MetricDetails1', @objtype = N'OBJECT'
END

--Migration_RCCP_20220908_162135.txt
ALTER TABLE [dbo].[MetricDetails] DROP CONSTRAINT [PK_dbo.MetricDetails]
DECLARE @var0 nvarchar(128)
SELECT @var0 = name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.MetricDetails')
AND col_name(parent_object_id, parent_column_id) = 'ID';
IF @var0 IS NOT NULL
    EXECUTE('ALTER TABLE [dbo].[MetricDetails] DROP CONSTRAINT [' + @var0 + ']')
ALTER TABLE [dbo].[MetricDetails] ALTER COLUMN [ID] [int] NOT NULL
ALTER TABLE [dbo].[MetricDetails] ADD CONSTRAINT [PK_dbo.MetricDetails] PRIMARY KEY ([ID])
DROP TABLE [dbo].[MetricTables]

--Migration_RCCP_20220908_162728.txt
ALTER TABLE [dbo].[MetricDetails] DROP CONSTRAINT [PK_dbo.MetricDetails]
DECLARE @var0 nvarchar(128)
SELECT @var0 = name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.MetricDetails')
AND col_name(parent_object_id, parent_column_id) = 'ID';
IF @var0 IS NOT NULL
    EXECUTE('ALTER TABLE [dbo].[MetricDetails] DROP CONSTRAINT [' + @var0 + ']')
ALTER TABLE [dbo].[MetricDetails] ALTER COLUMN [ID] [int] NOT NULL
ALTER TABLE [dbo].[MetricDetails] ADD CONSTRAINT [PK_dbo.MetricDetails] PRIMARY KEY ([ID])
DROP TABLE [dbo].[MetricTables]

--Migration_RCCP_20220908_171047.txt
ALTER TABLE [dbo].[MetricDetails] DROP CONSTRAINT [PK_dbo.MetricDetails]
DECLARE @var0 nvarchar(128)
SELECT @var0 = name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.MetricDetails')
AND col_name(parent_object_id, parent_column_id) = 'ID';
IF @var0 IS NOT NULL
    EXECUTE('ALTER TABLE [dbo].[MetricDetails] DROP CONSTRAINT [' + @var0 + ']')
ALTER TABLE [dbo].[MetricDetails] ALTER COLUMN [ID] [int] NOT NULL
ALTER TABLE [dbo].[MetricDetails] ADD CONSTRAINT [PK_dbo.MetricDetails] PRIMARY KEY ([ID])
DROP TABLE [dbo].[MetricTables]

--Migration_RCCP_20220908_174415.txt
ALTER TABLE [dbo].[MetricDetails] DROP CONSTRAINT [PK_dbo.MetricDetails]
DECLARE @var0 nvarchar(128)
SELECT @var0 = name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.MetricDetails')
AND col_name(parent_object_id, parent_column_id) = 'ID';
IF @var0 IS NOT NULL
    EXECUTE('ALTER TABLE [dbo].[MetricDetails] DROP CONSTRAINT [' + @var0 + ']')
ALTER TABLE [dbo].[MetricDetails] ALTER COLUMN [ID] [int] NOT NULL
ALTER TABLE [dbo].[MetricDetails] ADD CONSTRAINT [PK_dbo.MetricDetails] PRIMARY KEY ([ID])
DROP TABLE [dbo].[MetricTables]

--Migration_RCCP_20220908_180826.txt
ALTER TABLE [dbo].[MetricDetails] DROP CONSTRAINT [PK_dbo.MetricDetails]
DECLARE @var0 nvarchar(128)
SELECT @var0 = name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.MetricDetails')
AND col_name(parent_object_id, parent_column_id) = 'ID';
IF @var0 IS NOT NULL
    EXECUTE('ALTER TABLE [dbo].[MetricDetails] DROP CONSTRAINT [' + @var0 + ']')
ALTER TABLE [dbo].[MetricDetails] ALTER COLUMN [ID] [int] NOT NULL
ALTER TABLE [dbo].[MetricDetails] ADD CONSTRAINT [PK_dbo.MetricDetails] PRIMARY KEY ([ID])
DROP TABLE [dbo].[MetricTables]

--Migration_RCCP_20220908_181249.txt
DROP TABLE [dbo].[MetricDetails]
DROP TABLE [dbo].[MetricTables]

--Migration_RCCP_20220908_183524.txt
DROP TABLE [dbo].[MetricTables]
