Uploaded image for project: 'mod-data-export'
  1. mod-data-export
  2. MDEXP-402

Migration Script does not handle all cases

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • P3
    • Resolution: Done
    • None
    • 4.2.0
    • None
    • Concorde - Sprint 117, Concorde - Sprint 118
    • 2
    • Concorde

    Description

      Overview:
      The migration script to convert the string value of progress.total into an int value does not handle the cases where the progress object is not null but empty or is missing the "total" and "failed" properties. This leads to a SQL error when executing the script.

      Steps to Reproduce:
      Run this script

      UPDATE <tenatnId>_mod_data_export.job_executions SET jsonb = jsonb_set(jsonb #- '

      {progress, total}', '{progress, total}

      ', to_jsonb((jsonb -> 'progress' ->> 'total')::int))
      WHERE jsonb -> 'progress' IS NOT NULL

      with records having
      "progress":

      { "exported": 451 }

      or
      "progress": {},

      Expected Results:

      • Gracefully skipping over these records

      Actual Results:
      Script throws error

      Interested parties:
      sduvvuri magdaz

      TestRail: Results

        Attachments

          Issue Links

            Activity

              People

                TotoroDev Illia Daliek
                mtraneis Martin Tran
                Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  TestRail: Runs

                    TestRail: Cases