fabric8-services / fabric8-wit

wit stands for Work Item Tracker
http://devdoc.almighty.io/
Apache License 2.0
45 stars 86 forks source link

Add migrations for field name rename #2340

Closed jarifibrahim closed 5 years ago

jarifibrahim commented 5 years ago

Depends on https://github.com/fabric8-services/fabric8-wit/pull/2337

This PR adds migrations for renaming all the system.* fields to system_fields in the database. We rename fields in work_item_types , work_item and work_item_revisions table.

The migration will generate logs similar to

DROP TABLE
CREATE TABLE
INSERT 0 18
INFO:  work_item_types table field rename started
INFO:    Renaming fields of work_item_types 16bcbe81-f72f-4aa4-85c2-bbb97b4ec75f
INFO:      Changing field name from system.area to system_area
INFO:      Changing field name from system.order to system_order
INFO:  work_item_types table field rename completed
INFO:  work_items table field rename started
INFO:    Renaming fields of work_items bc763f93-e45b-4ac9-bf96-e015877109d2
INFO:      Changing field name from system.title to system_title
INFO:      Changing field name from system.number to system_number
INFO:  work_items table field rename completed
INFO:  work_item_revisions table field rename started
INFO:    Renaming fields of work_item_revisions 2845d9b5-862e-4d97-9448-947e902e5909
INFO:      Changing field name from system.title to system_title
INFO:      Changing field name from system.number to system_number
INFO:  work_item_revisions table field rename completed
codecov[bot] commented 5 years ago

Codecov Report

:exclamation: No coverage uploaded for pull request base (osio-story-743-rename-fields@79884ce). Click here to learn what that means. The diff coverage is 100%.

Impacted file tree graph

@@                       Coverage Diff                       @@
##             osio-story-743-rename-fields    #2340   +/-   ##
===============================================================
  Coverage                                ?   70.21%           
===============================================================
  Files                                   ?      171           
  Lines                                   ?    16647           
  Branches                                ?        0           
===============================================================
  Hits                                    ?    11688           
  Misses                                  ?     3832           
  Partials                                ?     1127
Impacted Files Coverage Δ
migration/migration.go 69.28% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 79884ce...fd6846b. Read the comment docs.

codecov-io commented 5 years ago

Codecov Report

:exclamation: No coverage uploaded for pull request base (osio-story-743-rename-fields@79884ce). Click here to learn what that means. The diff coverage is 100%.

Impacted file tree graph

@@                       Coverage Diff                       @@
##             osio-story-743-rename-fields    #2340   +/-   ##
===============================================================
  Coverage                                ?   70.21%           
===============================================================
  Files                                   ?      171           
  Lines                                   ?    16647           
  Branches                                ?        0           
===============================================================
  Hits                                    ?    11688           
  Misses                                  ?     3832           
  Partials                                ?     1127
Impacted Files Coverage Δ
migration/migration.go 69.28% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 79884ce...c54577c. Read the comment docs.

jarifibrahim commented 5 years ago

Please discuss with ops guys and maybe UI how we can run such a huge migration. This will mean some outage for sure.

Sure @kwk. But let's do that when we merge to master. Let's get all the piece together before we talk to the ops guys.