SQL version control methodology

前端 未结 6 1175
一生所求
一生所求 2021-02-02 14:33

There are several questions on SO about version control for SQL and lots of resources on the web, but I can\'t find something that quite covers what I\'m trying to do.

F

6条回答
  •  误落风尘
    2021-02-02 14:59

    Yes, you're asking for a lot, but they're all really pertinent points! Here at Red Gate we're moving towards a complete database development solution with our SQL Source Control SSMS extension and we're facing similar challenges.

    http://www.red-gate.com/products/SQL_Source_Control/index.htm

    For the upcoming release we're fully supporting schema changes, and supporting static data indirectly via our SQL Data Compare tool. All changes are saved as creation scripts, although when you're updating or deploying to a database, the tool will ensure that the changes are applied appropriately as an ALTER or CREATE.

    The most challenging requirement that doesn't yet have a simple solution is version management and deployment, which you describe very clearly. If you make complex changes to the schema and data, it may be inevitable that a handcrafted migration script is constructed to get between two adjacent versions, as not all of the 'intent' is always saved alongside a newer version. Column renames are a prime example. The solution could be for a system to be devised that saves the intent, or if this is too complex, allows the user to supply a custom script to perform the complex change. Some sort of version management framework would manage these and "magically" construct deployment scripts from two arbitrary versions.

提交回复
热议问题