RedGate: Сбой проверки схемы перед обновлением
Я пытаюсь развернуть простую базу данных с одной таблицей и несколькими сценариями миграции в Azure SQL, но она завершается неудачно со следующим сообщением:
Use-DlmDatabaseRelease: сбой проверки схемы перед обновлением: схема в объекте Database Release (создан 16.07.2008 11:32:50 AM -05:00) и база данных 'HM_CI' на сервере '----- -------.database.windows.net 'разные или статические данные разные.
Не могу понять, в чем проблема. Пытался запустить Update.sql на локальной машине и все работает нормально. Я подозреваю, что в схеме Azure SQL есть какая-то проблема, и поэтому она не хочет работать, но не знает, что именно.
Требуется ли какая-либо конкретная конфигурация для развертывания Azure SQL?
/*Generated on 16/Jul/2018 11:32 by Redgate DLM Automation v2.0.7.256*/
SET NUMERIC_ROUNDABORT OFF
GO
SET ANSI_PADDING, ANSI_WARNINGS, CONCAT_NULL_YIELDS_NULL, ARITHABORT, QUOTED_IDENTIFIER, ANSI_NULLS ON
GO
SET XACT_ABORT ON
GO
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE
GO
BEGIN TRANSACTION
GO
PRINT N'Creating [RedGateLocal].[DeploymentMetadata] for migration script history'
GO
IF SCHEMA_ID(N'RedGateLocal') IS NULL
EXEC sp_executesql N'CREATE SCHEMA [RedGateLocal] AUTHORIZATION [dbo]'
GO
IF OBJECT_ID(N'[RedGateLocal].[DeploymentMetadata]') IS NULL
BEGIN
CREATE TABLE [RedGateLocal].[DeploymentMetadata] (
[Id] INT NOT NULL PRIMARY KEY IDENTITY(1,1),
[Name] NVARCHAR(max) NOT NULL,
[Type] VARCHAR(50) NOT NULL,
[Action] VARCHAR(50) NOT NULL,
[By] NVARCHAR(128) NOT NULL DEFAULT ORIGINAL_LOGIN(),
[As] NVARCHAR(128) NOT NULL DEFAULT SUSER_SNAME(),
[CompletedDate] DATETIME NOT NULL DEFAULT GETDATE(),
[With] NVARCHAR(128) NOT NULL DEFAULT APP_NAME(),
[BlockId] VARCHAR(50) NOT NULL,
[InsertedSerial] BINARY(8) NOT NULL DEFAULT @@DBTS + 1,
[UpdatedSerial] TIMESTAMP NOT NULL,
[MetadataVersion] VARCHAR(50) NOT NULL,
[Hash] NVARCHAR(max) NULL
)
EXEC sp_addextendedproperty N'MS_Description', N'This table records deployments with migration scripts. Learn more: http://rd.gt/230GBP3', 'SCHEMA', N'RedGateLocal', 'TABLE', N'DeploymentMetadata', NULL, NULL
END
GO
PRINT N'Executing: Changes before migration script ''Covers changes to: HD, HM. Script created at 2018-06-20 13:24.'''
GO
IF @@ERROR <> 0 SET NOEXEC ON
GO
PRINT N'Creating [dbo].[HD]'
GO
CREATE TABLE [dbo].[HD]
(
[HDId] [int] NOT NULL IDENTITY(1, 1),
[FileContent] [varbinary] (max) NULL,
[FileName] [nvarchar] (260) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[ClientId] [int] NOT NULL,
[CreatedDate] [datetime] NOT NULL CONSTRAINT [DF__HM_CreatedDate] DEFAULT (getdate())
)
GO
IF @@ERROR <> 0 SET NOEXEC ON
GO
PRINT N'Creating primary key [PK_HM] on [dbo].[HD]'
GO
ALTER TABLE [dbo].[HD] ADD CONSTRAINT [PK_HM] PRIMARY KEY CLUSTERED ([HDId])
GO
IF @@ERROR <> 0 SET NOEXEC ON
GO
PRINT N'Finished executing: Changes before migration script ''Covers changes to: HD, HM. Script created at 2018-06-20 13:24.'''
GO
INSERT INTO [RedGateLocal].[DeploymentMetadata] ([Name], [Type], [Action], [BlockId], [MetadataVersion])
VALUES (N'Changes before migration script ''Covers changes to: HD, HM. Script created at 2018-06-20 13:24.''', 'Compare', 'Deployed', '2018-06-20-132615 jj auto', '5.60.0.72')
GO
PRINT N'Executing: Migration script ''Covers changes to: HD, HM. Script created at 2018-06-20 13:24.'''
GO
/*
This migration script replaces uncommitted changes made to these objects:
HD
HM
Renaming table to HM
*/
SET NUMERIC_ROUNDABORT OFF
GO
SET ANSI_PADDING, ANSI_WARNINGS, CONCAT_NULL_YIELDS_NULL, ARITHABORT, QUOTED_IDENTIFIER, ANSI_NULLS ON
GO
EXEC sp_rename '[dbo].[HD]', 'HM';
GO
PRINT N'Finished executing: Migration script ''Covers changes to: HD, HM. Script created at 2018-06-20 13:24.'''
GO
INSERT INTO [RedGateLocal].[DeploymentMetadata] ([Name], [Type], [Action], [BlockId], [MetadataVersion])
VALUES (N'Migration script ''Covers changes to: HD, HM. Script created at 2018-06-20 13:24.''', 'Migration', 'Deployed', '2018-06-20-132615 jk user', '5.60.0.72')
GO
PRINT N'Executing: Changes before migration script ''Covers changes to: HM. Script created at 2018-06-20 13:26.'''
GO
IF @@ERROR <> 0 SET NOEXEC ON
GO
PRINT N'Finished executing: Changes before migration script ''Covers changes to: HM. Script created at 2018-06-20 13:26.'''
GO
INSERT INTO [RedGateLocal].[DeploymentMetadata] ([Name], [Type], [Action], [BlockId], [MetadataVersion])
VALUES (N'Changes before migration script ''Covers changes to: HM. Script created at 2018-06-20 13:26.''', 'Compare', 'Deployed', '2018-06-20-133132 jl auto', '5.60.0.72')
GO
PRINT N'Executing: Migration script ''Covers changes to: HM. Script created at 2018-06-20 13:26.'''
GO
/*
This migration script replaces uncommitted changes made to these objects:
HM
Renaming Column
*/
SET NUMERIC_ROUNDABORT OFF
GO
SET ANSI_PADDING, ANSI_WARNINGS, CONCAT_NULL_YIELDS_NULL, ARITHABORT, QUOTED_IDENTIFIER, ANSI_NULLS ON
GO
EXEC sp_rename 'dbo.HM.HDId', 'HMId', 'COLUMN';
GO
PRINT N'Finished executing: Migration script ''Covers changes to: HM. Script created at 2018-06-20 13:26.'''
GO
INSERT INTO [RedGateLocal].[DeploymentMetadata] ([Name], [Type], [Action], [BlockId], [MetadataVersion])
VALUES (N'Migration script ''Covers changes to: HM. Script created at 2018-06-20 13:26.''', 'Migration', 'Deployed', '2018-06-20-133132 jm user', '5.60.0.72')
GO
IF @@ERROR <> 0 SET NOEXEC ON
GO
SET NUMERIC_ROUNDABORT OFF
GO
SET ANSI_PADDING, ANSI_WARNINGS, CONCAT_NULL_YIELDS_NULL, ARITHABORT, QUOTED_IDENTIFIER, ANSI_NULLS, NOCOUNT ON
GO
SET DATEFORMAT YMD
GO
SET XACT_ABORT ON
GO
-- Pointer used for text / image updates. This might not be needed, but is declared here just in case
DECLARE @pv binary(16)
COMMIT TRANSACTION
GO
IF @@ERROR <> 0 SET NOEXEC ON
GO
DECLARE @Success AS BIT
SET @Success = 1
SET NOEXEC OFF
IF (@Success = 1) PRINT 'The database update succeeded'
ELSE BEGIN
IF @@TRANCOUNT > 0 ROLLBACK TRANSACTION
PRINT 'The database update failed'
END
GO