incubator-devlake icon indicating copy to clipboard operation
incubator-devlake copied to clipboard

[Feature][migration] data migration helper with rollback

Open mappjzc opened this issue 3 years ago • 0 comments

Search before asking

  • [X] I had searched in the issues and found no similar feature requirement.

Description

most of time,If we want to migration a table. we use the flow step.

  1. rename TABLE to TEMP (stop if error, define defer to rename back on error)
  2. create new TABLE (stop if error, define defer to drop TABLE on error)
  3. convert data from TEMP to TABLE (stop if error)
  4. drop TEMP.

It‘s better to create one helper function to do it.

Use case

No response

Related issues

No response

Are you willing to submit a PR?

  • [X] Yes I am willing to submit a PR!

Code of Conduct

mappjzc avatar Sep 21 '22 16:09 mappjzc