English 中文(简体)
管理非行移徙:文字与工具
原标题:Managing DB migration: scripts vs tools

我们的项目有大约20个开发商,但我们的申请相对较少地利用数据库。 我们收集了大约5个数据库,所有这些数据库都非常小,每个数据库的浏览量不到20个,其中没有一个有数百万个或大的。

我们有两种选择:如何长期管理数据库的演变:

  • Some kind of tool. Currently we re using Visual Studio database projects, which contain the current definition of the schema, and look at a reference database to generate a diff script. We then use this diff script to bring the reference database up to date.
  • Use version scripts to build the database from a baseline. The scripts are manually placed in source control. Any data migration to move data from old columns/tables to new would be part of these scripts. There would be a version recorded in the DB somewhere and upgrading would run all scripts between DB version and the current version.

第二种选择似乎得到广泛使用,我在这里进行了深入讨论:http://odetocode.com/blogs/scott/archive/2008/01/31/versioning-databases-the-baseline.aspx

The problem we have with what we ve got at the moment is that we don t have access over our Production databases. This means to create a release package, we have to restore a backup of Production into another location, generate a diff against that referece DB and give the script to the production DB team. So our release to production is different to our other environments.

这使得有人呼吁使用版本的文字,因为我们在所有环境中都使用同样的文字,而且在部署时没有临时工作(例如恢复参考行的人工)。 但是,鉴于我们有如此小规模的非行局势,我感到,像我们一样,很难为非行的工具在那里找到一个困难的例子。 我们想要的是尽可能简单易懂的东西。

红色盖特等工具是否对这种假想具有意义,或者我们是否应当使用版本的文字? 这个问题的代价太高,更需要建立一个成功平台,使亚洲开发银行的维持和部署尽可能基本和自动化。

最佳回答

在我的经验中,总是比单纯的图谋变化更重要。 如果将一栏分成两栏,或将一栏改为单独的表格,或其他此类事项,则需要将图表和数据进行迁移。

任何工具或文字都不允许你自动迁移实际数据。 在大多数情况下,贵方会发现该表是有用的,作为非行版本的移民口的提醒/核对清单(在单一交易中添加/更新/填写)。

问题回答

I m 比较公司Red Gate的产品经理,在两个数据库之间生成手稿。 我恳请大家看看一下我们的“金库”控制工具,它将使你能够像在发展中所做的那样跟踪计划变化。 在部署方面,如果你知道有哪一种图形版本正在生产,你就可以从你的源头控制版本中产生一个部署文字。 当然,在生产开始之前,你应始终在一种老化的环境中进行试验。

Scott的文章在移民描述方面是一个极好的方面,Denis提到更为复杂的变化,这些变化实际上可以通过比较工具进行二次猜测,因此,需要妥善管理和使用习惯移徙文字。 因此,下版的比较法和地理数据控制将同时管理你的化学版本 ,使你们都能获得两个世界的最佳选择。 如果你想看到这方面的早期筛选,请在David dot Atkinson通过红门校礼寄送我。 我真的热爱讨论你们的要求,以便我们能够更好地设计这一工具。





相关问题
what is wrong with this mysql code

$db_user="root"; $db_host="localhost"; $db_password="root"; $db_name = "fayer"; $conn = mysqli_connect($db_host,$db_user,$db_password,$db_name) or die ("couldn t connect to server"); // perform query ...

Users asking for denormalized database

I am in the early stages of developing a database-driven system and the largest part of the system revolves around an inheritance type of relationship. There is a parent entity with about 10 columns ...

Easiest way to deal with sample data in Java web apps?

I m writing a Java web app in my free time to learn more about development. I m using the Stripes framework and eventually intend to use hibernate and MySQL For the moment, whilst creating the pages ...

join across databases with nhibernate

I am trying to join two tables that reside in two different databases. Every time, I try to join I get the following error: An association from the table xxx refers to an unmapped class. If the ...

How can I know if such value exists in database? (ADO.NET)

For example, I have a table, and there is a column named Tags . I want to know if value programming exists in this column. How can I do this in ADO.NET? I did this: OleDbCommand cmd = new ...

Convert date to string upon saving a doctrine record

I m trying to migrate one of my PHP projects to Doctrine. I ve never used it before so there are a few things I don t understand. In my current code, I have a class similar to this: class ...

热门标签