VSTS 构建阶段的 ReadyRoll 服务器详细信息

ReadyRoll server details for VSTS Build phase

我正在尝试为 ReadyRoll 实施 CI/CD。对于发布部分,我使用的是 Azure SQL 服务器,因此我在其中指定了服务器名称、数据库名称和信用。但是,我不确定在创建影子数据库时我为构建组件提供了哪些细节。我以为它们是一样的,但后来我收到一条错误消息,说它试图在我的 azure sql 服务器中创建一个数据库,但它失败了,因为那里已经有一个同名的数据库。这让我觉得我提供了错误的值,但我不确定我要提供什么。

ReadyRoll maintains two databases:

•Target database

This is the development database or sandbox that you use for debugging and to edit schema objects (e.g. using SSMS). When you deploy, ReadyRoll executes your migration scripts against this database to upgrade it. You shouldn't drop the target database from your SQL Server instance.

•Shadow database

This is an exact copy of your database schema created automatically from your project scripts (001.sql, 002.sql, 003.sql, etc). It's created every time you use the ReadyRoll DbSync tool to view pending changes or import. The shadow database is used by the SQL Compare engine (that powers ReadyRoll) as the base from which to generate a new migration script. It is safe to drop the database at any time.

更多信息:Target and shadow databases

您可以为影子数据库指定这些参数:ShadowServer、ShadowUserName、ShadowPassword、ShadowDatabase。 (您也可以只指定目标数据库)

更多信息:Shadow database

Visual Studio 构建任务的 MSBuild 参数示例:

/p:TargetServer=XXX.database.windows.net  /p:TargetUsername=XXX /p:TargetPassword=XXX /p:ShadowServer=XXX /p:TargetDatabase=XXX /p:GenerateSqlPackage=True /p:SkipDriftAnalysis=True /p:ShadowUserName=XXX /p:ShadowPassword=XXX /p:DBDeployOnBuild=True