0

So for better or worse we've got two database projects that have essentially the same schema. The only differences being that Database 2 has a few more indexes than Database 1. Is there an easy way to keep those two projects in synch on the schema but still have those extra indexes in the Database 2 project? I essentially only want to keep the differences in the Database 2 project. The problem is trying to keep the projects in synch when making schema changes. I don't want to make the changes in two places.

4

2 回答 2

1

如果唯一的变化是额外的索引,那么复合项目可能是你最好的选择。您可以制作您的主要项目,然后将您的第二个项目基于此并添加索引。Jamie Thomson 在这里写了博客:http: //sqlblog.com/blogs/jamie_thomson/archive/2013/03/10/deployment-of-client-specific-database-code-using-ssdt.aspx

或者,您可以使用部署后脚本和 SQLCMD 变量仅将这些索引推送到数据库 2。它不像复合项目那样简单,但可以在您的情况下工作。

于 2013-05-16T16:41:00.813 回答
0

[假设你的意思是 SSDT]

最简单的解决方案可能是使用分支。让根分支是具有额外索引的架构,并在不带索引的情况下分支出架构。在子分支中进行更改,并将这些更改合并到根中。您仍然可以部署任一架构。

于 2013-05-16T16:07:25.483 回答