refactor: migrations to change constraints to allow verion 0 and backfill for old records
Refactor: enable version 0 for record history and backfill old records with version 0
Format: refactor(scope): short description Example: refactor(auth): simplify token validation logic
Description
This merge request refactors existing code to allow version 0 in record history. And has backfill scripts to backfill the version 0 for the old records.
There are 2 backfills in this MR:
- One backfill in the migrations for the records which do not have any record history
- A backfill script for more complex backfill where we have to reconstruct the version 0 from version 1
Checklist
-
Code has been refactored for clarity, maintainability, or performance. -
No functional changes have been introduced. -
All existing tests are passing. -
Code adheres to project coding standards.
Related Issue(s)
Closes #89 (closed)