Uploaded image for project: 'SonarQube'
  1. SonarQube
  2. SONAR-15234

DB migrations should always be re-entrant

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 9.1
    • Component/s: Database
    • Labels:
      None
    • Edition:
      Community
    • Production Notes:
      None

      Description

      DB migration steps should always be re-entrant. This way, if the server is suddenly stopped or crashes, the migration can be resumed.

      For example, if step 1234 is being executed when the server stops, upon restart the server should see that step 1233 was completed and start doing step 1234 again.

      We often write the migration steps in a re-entrant way, but not always.

      To complete this ticket, we should:

      • Ensure that we have all the tools to write re-entrant migration steps (functions to check if a column or table already exists, etc).
      • Ideally, have the tests run each migration twice.
      • Fix the existing migrations if needed.

        Attachments

          Activity

            People

            Assignee:
            jacek.poreda Jacek Poreda
            Reporter:
            duarte.meneses Duarte Meneses
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: