管理我的数据库的源代码控制 [英] Managing My Database in Source Control

查看:126
本文介绍了管理我的数据库的源代码控制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于我有一个新的数据库的项目工作(在VS2008),并作为我从来没有开发的数据库从头开始,我立刻开始寻找如何管理在源代码管理数据库(在这种情况下,Subversion的)。

As I am working with a new database project (within VS2008), and as I have never developed a database from scratch, I immediately began looking into how to manage a database within source control (in this case, Subversion).

我发现等等一些信息,包括这篇文章:<一个href="http://stackoverflow.com/questions/40957/keeping-development-databases-in-multiple-environments-in-sync">Keeping开发数据库在多种环境中同步。 <一href="http://stackoverflow.com/questions/40957/keeping-development-databases-in-multiple-environments-in-sync/41217#41217">One特别中的答案的指出了一些的链接,所有这些都具有良好的,有用的信息。

I found some information on SO, including this post: Keeping development databases in multiple environments in sync. One of the answers in particular pointed to a number of a links, all of which had good, useful information.

我在读的系列帖子将K.斯科特·艾伦中,描述他如何管理数据库的变化。从我的阅读(和请原谅我的问题noobishness),却仿佛数据库本身是从来没有检查到存储库。相反,可以建立数据库,以及测试数据(这也从填充脚本)脚本签入存储库。最终,这意味着,当开发人员正在测试自己的应用程序,这些脚本,这是构建过程的一部分,正在运行。这样可以确保数据库是最新的最新的,但也从当地每个开发人员的计算机上运行。

I was reading a series of posts by K. Scott Allen which describe how he manages database change. From my reading (and please pardon the noobishness of my question), it seems as though the database itself is never checked into a repository. Rather, scripts that can build the database, along with test data (which is also populated from scripts) is checked into the repository. Ultimately, this means that, when a developer is testing his or her app, these scripts, which are part of the build process, are run. This ensures that the database is up-to-date, but is also run locally from every developer's machine.

这是有道理的,我(如果我确实是正确的阅读)。但是,如果我失去了一些东西,我会AP preciate更正或更多的指导。此外,另外一个问题我想问 - 这是否也意味着我要不会检查在从创建了的中密度纤维板 LDF 的文件Visual Studio的?

This makes sense to me (if I am indeed reading that correctly). However, if I am missing something, I would appreciate correction or additional guidance. In addition, another question I wanted to ask - does this also mean that I should NOT check in the mdf or ldf files that are created from Visual Studio?

感谢您的帮助和额外的洞察力。始终AP preciated。

Thanks for any help and additional insight. Always appreciated.

推荐答案

这是正确的,你应该检查脚本而不是数据库文件本身。

That is correct you should check in scripts not the database file itself.

林不从测试数据构建除非数据本身会模仿数据的大小,以便生产具有(或在,新数据库的情况下,意在有)的风扇。为什么?因为写作code对表有100条记录并不能告诉你,如果它会及时运行,当你有10,000,000条记录。我有太多的糟糕的设计选择的人谁想到一个小数据集的发展确定进行。

I'm not a fan of building from test data unless the data itself will mimic the size of data that production has (or in,the case of new databases, is intended to have) . Why? because writing code against a table with 100 records doesn't tell you if it will run in a timely fashion when you have 10,000,000 records. I've way too many bad design choices made from people who think a small data set is OK for development.

下面,我们不允许开发者以对他们的盒一个单独的数据库(其通常限制了数据库可以由不被连接到SAN的一个服务器的的美德的大小),而不是它们必须打击dev的数据库,该数据库是从PROD定期刷新(然后将所有新开发的脚本运行),以保持数据的权利的大小。我认为重要的是,你的开发datbase环境匹配督促尽可能包括设备配置,数据库等没有什么比花了很长时间developng的东西,在督促要么将不会在所有的工作,或有更令人沮丧的大小立即取下来,因为实在是太多了放缓的系统。

Here, we do not allow devs to have a separate database on their box (which typically limits the size the database can be by virture of not being a server attached to SAN), instead they must work against the dev database which is periodically refreshed from prod (and then all the new dev scripts run) to keep the data the right size. I think it is important that your dev datbase environment match prod as closely as possible including equipment configuration, size of the database etc. Nothing more frustrating than spending a long time developng something that either won't work at all on prod or has to be taken down immediately because it is slowing the system too much.

跳下了我的长篇大论了。

Jumping down off my soapbox now.

这篇关于管理我的数据库的源代码控制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆