How to continuously delivery SQL-based app?

前端 未结 3 1893
故里飘歌
故里飘歌 2021-01-17 04:54

I\'m looking to apply continuous delivery concepts to web app we are building, and wondering if there any solution to protecting the database from accidental erroneous commi

3条回答
  •  盖世英雄少女心
    2021-01-17 05:13

    One of the strategies that is commonly adopted is to log the incremental sql statements rather than a collective schema generation so you can control the change at a much granular levels:

    ex: 
    change 1:
    UP:
    Add column
    DOWN:
    Remove column
    
    change 2:
    UP:
    Add trigger
    DOWN:
    Remove trigger
    

    Once the changes are incrementally captured like this, you can have a simple but efficient script to upgrade (UP) from any version to any version without having to worry about the changes that happening. When the change # are linked to build, it becomes even more effective. When you deploy a build the database is also automatically upgraded(UP) or downgraded(DOWN) to that specific build.

    We have an pipeline app which does that at CloudMunch.

提交回复
热议问题