You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have introduces several new fields in openchs-models, which are used in new CustomDashboards and related entities, with assumption that they are optional or so and would have values setup correctly on first sync post update.
But, in-case the org has CustomDashboard set as Primary Dashboard and their app gets upgraded, then after that App load would break everytime, preventing user from completing first time sync and hence result in him being forced to perform fresh sync.
AC
Perform all new Realm Entities fields initialization appropriately, so that app load does not fail after app upgrade without performing any sync post update.
Tech details
Based o code diff of 9.3 branch with 10.0 in Models repo, we found following places where we need to handle initialization of new columns of Realm Entities as part of Schema Migration for new CustomDashboardReportCards (Version 197):
StandardReportCardType => type and description fields //(Write code to init in same manner as in server, as shown below)
UPDATE standard_report_card_type
SET description = 'Recent registrations', last_modified_date_time = current_timestamp
WHERE name = 'Last 24 hours registrations';
UPDATE standard_report_card_type
SET description = 'Recent enrolments', last_modified_date_time = current_timestamp
WHERE name = 'Last 24 hours enrolments',;
UPDATE standard_report_card_type
SET description = 'Recent visits', last_modified_date_time = current_timestamp
WHERE name = 'Last 24 hours visits';
alter table standard_report_card_type add column type varchar(100) null;
update standard_report_card_type set type = replace(initcap(description), ' ', '') where 1 = 1;
alter table standard_report_card_type alter column type set not null;
ReportCard - standardReportCardInputSubjectTypes, standardReportCardInputPrograms or standardReportCardInputEncounterTypes or standardReportCardInputRecentDurationJSON
Issue
We have introduces several new fields in openchs-models, which are used in new CustomDashboards and related entities, with assumption that they are optional or so and would have values setup correctly on first sync post update.
But, in-case the org has CustomDashboard set as Primary Dashboard and their app gets upgraded, then after that App load would break everytime, preventing user from completing first time sync and hence result in him being forced to perform fresh sync.
AC
Perform all new Realm Entities fields initialization appropriately, so that app load does not fail after app upgrade without performing any sync post update.
Tech details
Based o code diff of 9.3 branch with 10.0 in Models repo, we found following places where we need to handle initialization of new columns of Realm Entities as part of Schema Migration for new CustomDashboardReportCards (Version 197):
DashboardFilterConfig => SubjectType // MysteryReportCard =>standardReportCardInputSubjectTypes: {type: "list", objectType: "SubjectType"}, //EmptyArraystandardReportCardInputPrograms: {type: "list", objectType: "Program"},//EmptyArraystandardReportCardInputEncounterTypes: {type: "list", objectType: "EncounterType"}, //EmptyArraystandardReportCardInputRecentDurationJSON: {type: "string", optional: true} // "{"value":"1","unit":"days"}"The text was updated successfully, but these errors were encountered: