RedGate:更新前架构检查失败

时间:2018-07-16 18:23:13

标签: azure-sql-database redgate

我正在尝试将具有一个表和几个迁移脚本的简单数据库部署到Azure SQL,但失败,并显示下一条消息:

  

Use-DlmDatabaseRelease:更新前模式检查失败:模式位于   数据库发布对象(在7/16/2018 11:32:50 AM创建   -05:00)和服务器'------------.database.windows.net'上的数据库'HM_CI'是不同的,或者静态数据是   不同。

无法找出问题所在。 试图在本地计算机上运行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

0 个答案:

没有答案