First of all, make sure you have your entire Database Build scripted so you can rebuild the database if needed.
Each change should then be written as an Update script. That way you can run each change individually against the your databases.
Once the change has been commited to the codebase, merge the change script with the build process so it happens automatically...and then archive the change script in case any questions arise.
First and foremost, put all database changes in scripts and put them into the source control system.
Next remove any permissions to production that developers have. Exactly two people should have rights on production in a small to medium shop, the designated dba and his or her designated alternate. Once devs can't make changes to prod, you will find it easier to get them to actually write and use scripts.
Never run a script on prod that wasn't first loaded to QA or staging. If there are issues with the script, it should be found at this point.
不确定您在这里问什么,但如果这是管理架构更改并使它们在版本和部署之间保持同步的好方法,那么 Visual Studio 数据库版就很难出错。它的唯一目的是管理数据库模式更改、验证模式、构建和生成部署脚本。如果您有 Visual Studio Developer Edition 或 Visual Studio Team Suite,则可以免费获取。
Not sure what you are asking here, but if it's a good way to manage schema changes, and keeping them in synch between versions and deployments, it's hard to go wrong with Visual Studio Database Edition. It's sole purpose in life is to manage database schema changes, validate the schema, build and generate deployment scripts. If you have Visual Studio Developer Edition or Visual Studio Team Suite, you can get it for free.
发布评论
评论(6)
首先,确保您编写了整个数据库构建脚本,以便在需要时可以重建数据库。
每个更改都应编写为更新脚本。这样您就可以针对数据库单独运行每个更改。
将更改提交到代码库后,将更改脚本与构建过程合并,以便它自动发生......然后归档更改脚本,以防出现任何问题。
First of all, make sure you have your entire Database Build scripted so you can rebuild the database if needed.
Each change should then be written as an Update script. That way you can run each change individually against the your databases.
Once the change has been commited to the codebase, merge the change script with the build process so it happens automatically...and then archive the change script in case any questions arise.
首先也是最重要的,将所有数据库更改放入脚本中,并将它们放入源代码控制系统中。
接下来删除开发人员拥有的所有生产权限。在中小型商店中,只有两个人应该拥有生产权限:指定的 dba 和他或她指定的替补。一旦开发人员无法对产品进行更改,您会发现让他们实际编写和使用脚本更容易。
切勿在未首先加载到 QA 或暂存的产品上运行脚本。如果脚本有问题,应该在此时找到。
First and foremost, put all database changes in scripts and put them into the source control system.
Next remove any permissions to production that developers have. Exactly two people should have rights on production in a small to medium shop, the designated dba and his or her designated alternate. Once devs can't make changes to prod, you will find it easier to get them to actually write and use scripts.
Never run a script on prod that wasn't first loaded to QA or staging. If there are issues with the script, it should be found at this point.
使用幂等 更改 脚本(也许可以看看 LiquiBase 或 dbdeploy)。
Use idempotent change scripts (and maybe have a look at LiquiBase or dbdeploy).
不确定您在这里问什么,但如果这是管理架构更改并使它们在版本和部署之间保持同步的好方法,那么 Visual Studio 数据库版就很难出错。它的唯一目的是管理数据库模式更改、验证模式、构建和生成部署脚本。如果您有 Visual Studio Developer Edition 或 Visual Studio Team Suite,则可以免费获取。
Not sure what you are asking here, but if it's a good way to manage schema changes, and keeping them in synch between versions and deployments, it's hard to go wrong with Visual Studio Database Edition. It's sole purpose in life is to manage database schema changes, validate the schema, build and generate deployment scripts. If you have Visual Studio Developer Edition or Visual Studio Team Suite, you can get it for free.
嗯,我们目前正在使用 Redgate 的工具带,其中包含数据库比较、数据比较等。
您还可以使用任何源代码控制来跟踪数据库对象的更改。
Well, we are currently using Redgate's toolbelt which contains a Database Compare, Data Compare, etc.
You can also use any source control to track changes to your database objects.
就我而言,我为此工作构建了一个 SH 脚本:
https://github.com/reduardo7/ db-version-updater
和 MySQL 脚本:
https://github.com /reduardo7/db-version-updater-mysql
In my case, I build a SH script for this work:
https://github.com/reduardo7/db-version-updater
And a MySQL script:
https://github.com/reduardo7/db-version-updater-mysql