Looking for solution for database versioning

后端 未结 6 1219
忘掉有多难
忘掉有多难 2021-01-04 18:19

Problem description:

In our project we have one \"production database\" and many \"devs\". We want to know how we can manage and install the changes. We already have

6条回答
  •  有刺的猬
    2021-01-04 18:32

    I do it very similarly, but use database extended properties instead of a table to track metadata version and the upgrade steps are defined in application, rather than a single script. Most upgrade steps are just execute script Upgrade.vX.Y.sql.

    I actually find your approach superior to schema comparison tools (and that includes VS DB deployment) for several reasons:

    • I don't trust schema comparison tools changing very large tables, I rather have a tested script specifically designed for my table of 150B records.
    • Schema comparison doesn't handle removal of obsolete objects
    • If the application schema was modified at a client site a comparison tool will blindly attempt to upgrade it, but a modified schema may need special treatment: inspection of the changes, evaluation of impact, billing of extra work.

提交回复
热议问题