SQL Server 版本控制?
我的开发小组使用 Visual Source Safe 进行版本控制;这一选择最初是由于成本及其与 Visual Studio 的紧密集成而做出的。
随着我们的存储库的增长,Source Safe 确实开始显示出其局限性,我们正在考虑转向另一个解决方案。可供讨论的有 Team Foundation Server、Subversion、Git 和 Mercurial。
我们主要是一家数据商店,因此对我们来说另一个主要因素是能够轻松地对 SQL Server 2005/2008 项目进行版本控制。这是使用 Source Safe 以及 Team Foundation Server 的好处之一 - 与 Microsoft SQL Server Management Studio 的集成。
我想知道是否有人有过使用 Subversion、Git 或 Mercurial 对 SQL Server 进行版本控制的经验,并且可以为每个系统提供一些可靠的优点/缺点,以及如何实现它们。
My development group uses Visual Source Safe for version control; this choice was originally made due to cost and its tight integration with Visual Studio.
As our repository has grown Source Safe has really started to show its limitations and we are considering moving to another solution. Up for discussion are Team Foundation Server, Subversion, Git, and Mercurial.
We are largely a data shop, so another major factor for us is being able to easily version SQL Server 2005/2008 projects. This is one of the benefits of using Source Safe, and also of Team Foundation Server - the integration with Microsoft SQL Server Management Studio.
I'm wondering if anyone has had experience versioning SQL Server with Subversion, Git, or Mercurial and can provide some solid pros/cons for each of these systems, as well as how you went about implementing them.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(8)
我诚实的回答是,如果可以避免的话,不要与数据库工具和 SCM 进行任何集成。尽可能使用文件系统。这是另一层集成,这将是一个痛苦的过程。小型独立工具比庞然大物更好。
我们按以下方式一起使用 Subversion 和 SQL 2005:
从这个结构中,我们可以在任何时间点在任何机器上重新创建环境和数据库,这很重要。
然而,我们不将其用于单元测试 - 我们依靠 NHibernate 模式生成在 SQLite 数据库之上执行此操作。
我们遇到的唯一负面问题是确保开发人员遵守该流程。牧猫是一个非常恰当的描述。
My honest answer is don't do any integration with your database tooling and SCM if you can avoid it. Use the filesystem where possible. It's another layer of integration which is going to be a pain. Small separate tools are better than a behemoth.
We use Subversion and SQL 2005 together in the following manor:
From this structure, we can re-create the environment and database at any point in time on any machine which is important.
We do NOT use it for unit testing however - we rely on the NHibernate schema generation to do this on top of an SQLite database.
The only negative point we've encountered has been making sure that developers adhere to the process. Herding cats is a very appropriate description.
Visual Studio Team System 2008 数据库版(代号“DataDude”)正是您所需要的。
它允许您以令人惊叹的方式对数据库对象进行版本控制。 (例如,将客户站点升级到特定版本,或回滚到以前的版本而不破坏任何数据)。
查看 Gert Drapers 博客中的功能,从 这篇文章。
或者,如果您更喜欢播客,请收听 Chris Sells in show 494 的 DotNetRocks 。
我不知道在使用 DataDude 时您是否仅限于使用 TFS 进行源代码控制,但它是 Visual Studio 家族中不值得“低估”的成员。
Visual Studio Team System 2008 Database Edition (codename "DataDude") is what you need.
It allows you to version your database objects in ways that will blow your mind. (eg upgrade a customer site to a specific version, or rollback to a previous version without destroying any data).
Check out the features at Gert Drapers' blog, starting with this post.
Or if you prefer a podcast, listen to DotNetRocks with Chris Sells in show 494.
I don't know whether you're limited to TFS for source control, when using DataDude -- but it is the undeservedly "underhyped" member of the Visual Studio family.
这可能对您来说是一个有用的工具:
http://www.liquibase.org/
它的设计目的是为了在任何系统中轻松进行版本控制,并以合理的方式管理您的升级脚本。
This might be a useful tool for you:
http://www.liquibase.org/
It's designed so that it's easy to version control in any system, and manages your upgrade scripts in a sane way.
恕我直言,Git 和 Mercurial 是唯一您应该考虑的,其他 2 个都太过时了。现代 SCM 应该像 git 一样对待分支。
有关 git 与 Mercurial 的比较,请参阅:
http://rg03.wordpress。 com/2009/04/07/mercurial-vs-git/,http://www.russellbeattie.com/blog/distributed-revision-control-systems-git-vs-mercurial-vs-svn。
虽然我过去没有 SSMS SCM 集成的经验,但据我所知,提到的两个系统(除了 TFS)都没有经验。我不会称其为缺点 - 例如 git GUI 是一个非常方便的工具,您会发现它比这样的集成更令人愉快。至少这是我从 SVN(使用 Ankh 进行 VS 集成)迁移到 Git(根本没有集成)时的情况...
Git and Mercurial are the only ones you should consider IMHO, the other 2 are too old-fashioned. Modern SCMs should treat branches like git does.
For git vs. mercurial comparisons see:
http://rg03.wordpress.com/2009/04/07/mercurial-vs-git/, http://www.russellbeattie.com/blog/distributed-revision-control-systems-git-vs-mercurial-vs-svn.
I have no past experience with SSMS SCM integration though, but AFAIK neither of the systems mentioned (except from TFS) have one. I wouldn't call it a disadvantage tho - git GUI for example is a pretty handy tool, which you'll find more enjoyable than such an integration. This is at least my case when moving from SVN (with VS integration using Ankh) to Git (with no integration at all)...
如果您认为 DVCS 是最佳选择,Mercurial 已将 VS 与 VisualHG 集成。我们将其用于我们商店的 C++/C# 项目,并且效果很好。 (OTOH,我从未使用过任何“完整”集成,因此我很高兴使用资源管理器扩展和/或命令行来进行详细的 VC 工作。)
Mercurial has VS integration with VisualHG, if you think DVCS is the way to go. We use that for C++/C# projects in our shop, and it works well enough. (OTOH, I've never used any "full" integration, so I'm happy to work with the explorer extension and/or command-line for detailed VC work.)
我们现在已向 SQL 源代码控制添加了 VSS 支持,它与 SSMS 集成,为数据库开发提供完全集成的源代码控制。要尝试此操作,请访问:
http://www.red-gate.com/MessageBoard/viewtopic。 php?t=12265
We've now added VSS support to SQL Source Control, which integrates with SSMS to provide fully integrated source control for database development. To try this out, please visit:
http://www.red-gate.com/MessageBoard/viewtopic.php?t=12265
TFS 缺少 VSS 的一些功能,特别是关键字扩展。如果您没有在源文件中嵌入修订关键字信息,那么就不必担心。
TFS is missing a few features of VSS, notably keyword expansion. If you don't embed revision keyword info within your source files, then it should not be a concern.
可能有很多替代方案 - SQL Server Management Studio (SSMS) 支持与任何 Microsoft 源代码控制接口集成 MSSCCI 提供商。因此,您可以将搜索范围扩大到具有 MSSCCI 兼容提供商的源代码控制系统。
在 SSMS 中,查看工具 ->选项->源代码控制可查看您的系统上安装了哪些提供程序插件。
例如,Team Foundation Server 与 SQL Management Studio 的集成是由 TFS MSSCCI 提供程序提供的。我认为有一个 CVS/Subversion 的提供商(“Aigenta Unified SCC”)等等。
至于优缺点列表,我认为只要有兼容的提供商,您就可以向更广泛的受众开放这个问题。我的主要经验是使用 VSS、TFS 和 Subversion。这实际上取决于您的团队和环境。您能详细说明一下您的环境吗?
例如,
There are potentially quite a number of alternatives - SQL Server Management Studio (SSMS) supports integration with any Microsoft Source Code Control Interface MSSCCI Provider. So you can broaden the search to source control systems that feature an MSSCCI compatible provider.
In SSMS, Check out Tools -> Options -> Source Control to see what provider plug-ins are installed on your system.
For example, Team Foundation Server's integration with SQL Management Studio is courtesy of the TFS MSSCCI Provider. I think there's a provider for CVS/Subversion ("Aigenta Unified SCC") and so on.
As to a pros/cons list, I think provided there's a compatible provider, you can open the question up to a wider audience. My main experience is with VSS, TFS and Subversion. It really comes down to your team, and environment. Can you elaborate more on your environment?
E.g.