1

We are introducing new feature in our Web App and our database should react appropriately on new version rollout to Prod. As an example, set 0 value to table T1 for column C1 in case column C2 in Table T2 has true value.

What is the best way to change data on next rollout?

Also, we do not want that same data would be changed on next redeploy of the same product version.

So maybe it should be maybe some database trigger that will be invoked on rollout only.

Are there some common solutions for such sort of new features introductions?

Michael Z
  • 3,883
  • 10
  • 43
  • 57
  • 1
    The term you are looking for is "schema migration". In general you need SQL scripts that upgrade your database from version x to version x+1. There are many tools out there that help you with that, e.g. Liquibase –  Sep 10 '16 at 09:16
  • hmm...I need data migration but not schema migration. The DB schema will remain the same in my example. Maybe I missed some? – Michael Z Sep 10 '16 at 09:18
  • The principle is the same: create a SQL script that does it. The schema migration tools are all about controlling what to run on which environment. Whether the script runs an `update`, `alter table` or `create table` doesn't really matter. –  Sep 10 '16 at 09:23
  • What database are you using? – David Atkinson Sep 11 '16 at 22:26
  • Postgresql but my question is general, database agnostic – Michael Z Sep 12 '16 at 06:49

0 Answers0