
--Migration_RCCP_20240509_120259.txt
ALTER TABLE [dbo].[DashboardTemplates] ADD [LastUpdatedUserId] [bigint]
DECLARE @var0 nvarchar(128)
SELECT @var0 = name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.DashboardInstances')
AND col_name(parent_object_id, parent_column_id) = 'OwnerId';
IF @var0 IS NOT NULL
    EXECUTE('ALTER TABLE [dbo].[DashboardInstances] DROP CONSTRAINT [' + @var0 + ']')
ALTER TABLE [dbo].[DashboardInstances] ALTER COLUMN [OwnerId] [bigint] NULL
DECLARE @var1 nvarchar(128)
SELECT @var1 = name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.DashboardTemplates')
AND col_name(parent_object_id, parent_column_id) = 'OwnerId';
IF @var1 IS NOT NULL
    EXECUTE('ALTER TABLE [dbo].[DashboardTemplates] DROP CONSTRAINT [' + @var1 + ']')
ALTER TABLE [dbo].[DashboardTemplates] DROP COLUMN [OwnerId]
