标签云

微信群

扫码加入我们

WeChat QR Code


Also have a look at this white paper; The Definitive Guide to Database Version Control www3.dbmaestro.com/…

2018年12月11日14分17秒

Version controlling full schema scripts is very useful for reference purposes. For instance, it is impossible to see what exactly was changed in a stored procedure by looking at ALTER PROCEDURE statement.

2018年12月11日14分17秒

Dumping (and versioning) the full DB schema after running new upgrade scripts is a good way to make information available to other tools in your build/deploy process as well. Also, having the full schema in a script means being able to "spin up" a fresh database without going through all the migration steps. It also makes it possible to diff the current version against accumulated previous versions.

2018年12月11日14分17秒

Are saying that you put upgrade scripts in source control, nut do not put rollback ones there?

2018年12月10日14分17秒

I have a habit of maintaining a full create and drop script, as well as delta scripts for updating existing db instances up to date. Both go into version control. The delta scripts are named according to revision numbers. That way it's easy to automate db patching with an update script.

2018年12月11日14分17秒

nikc.org's answer, plus post-commit hooks for automation.

2018年12月11日14分17秒

We've just released SQL Source Control, which integrates the SQL Compare behavior you describe into SSMS, and links to SVN and TFS. I've added a separate answer to this question that describes in more detail what it does. red-gate.com/products/SQL_Source_Control/index.htm

2018年12月10日14分17秒

regarding the data - you can use OffScale DataGrove to save versions of your entire DB (data included). You can later use it to spawn up two virtual copies of your DB which can be compared with red-gate's product. It also saves you the need to generate test data - you can just save versions of the DB to match the different test-cases (again, full, virtual copies of the entire DB)

2018年12月11日14分17秒

How do you work out which order to run the database scripts if you use the "one file per object" option?

2018年12月10日14分17秒

Taichman: DataGrove does not seem to support SQL server, and as such has no relevance to the question.

2018年12月11日14分17秒

Interesting product (bit of a gap in the market) but deltas stored as "CREATE..." scare me. How are you branching/merging?

2018年12月11日14分17秒

We store the object definitions as CREATE, but if you 'get latest' or, for example, use SQL Compare Pro to generate sync scripts, these get changed to the appropriate commands, such as ALTER. To branch or merge, you'd simply use your source control system the same way as you currently do.

2018年12月11日14分17秒

This answer is a duplicate of Dane's answer posted two years earlier.

2018年12月11日14分17秒

It's a different answer. SQL Compare doesn't version control databases, whereas SQL Source Control was designed specifically for that.

2018年12月10日14分17秒

We use Liquibase in 5 distributed teams on a single branch for continuous delivery and it is working great. We have 10+ database applications installed on many different environments. We use it to manage schema, indexing, partitioning, code, lookup data, groups and group permissions. We use it for Oracle, Postgresql and MSSQL.

2018年12月11日14分17秒

If i understand correctly based on the intro, it requires you know some proprietary xml language to declare your objects instead of SQL? Not a fan.

2018年12月10日14分17秒

So there should be a system that tracks what columns you are changing and remember the mappings from old column names to the new column names.

2018年12月11日14分17秒

It's worth bearing in mind that for database changes that have ambiguity (and therefore need an element of "developer intent"), a migrations-based solution is the appropriate solution. Redgate now has ReadyRoll that satisfies this versioning approach.

2018年12月10日14分17秒

I've used DbGhost for 10 years and it's never let me down. The support they provide is second to none

1970年01月01日00分03秒

Yeah but unfortunately you have to remember to "generate script" every single time. If you directly update the database, you lose the ability to generate the update script for that delta. If only database projects would have some built-in functionality for versioning.

2018年12月10日14分17秒

After some years I say: Use FluentMigrator (or similar tool for your platform).

2018年12月11日14分17秒

Very useful script, thanks.

2018年12月11日14分17秒

Oooh, this would be great to make publicly available.

2018年12月10日14分17秒