Got feedback or spotted a mistake?

Leave a comment at the end of this page or email contact@krishagni.com

Fixing frozen and thaw events table

Prior to v4x, all specimen event forms shipped with OpenSpecimen were "app" managed in that their tables were created by app and DE was responsible for managing only metadata. Therefore whenever a new field was added to the event form, a change set was required in OpenSpecimen to explicitly add column to the event table. However this got changed in v4x which allowed DE to manage all non-system specimen event form tables as well. As a result, when someone upgrades from a older version to 4x later versions, they will find an attempt being made to add same column twice - first by OS by change sets in releases prior to v4x and secondly by DE resulting in duplicate column error. There are 2 instances where such errors will occur. To fix them follow below steps:

  1. Rename duplicate columns. This will allow DE to create metadata and add new table columns.

    alter table catissue_frozen_event_param rename column increment_freeze_thaw to increment_freeze_thaw_bk;
    alter table catissue_thaw_event_parameters rename column increment_freeze_thaw to increment_freeze_thaw_bk;
  2. Restart OpenSpecimen.

  3. After successful restart, as a final step, execute following DML to restore the original column values

    update catissue_frozen_event_param set increment_freeze_thaw = increment_freeze_thaw_bk;
    update catissue_thaw_event_parameters set increment_freeze_thaw = increment_freeze_thaw_bk;
    commit;
Got feedback or spotted a mistake?

Leave a comment at the end of this page or email contact@krishagni.com