Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(EMS-4035-4042): declarations - modern slavery - data migration #3408

Open
wants to merge 3 commits into
base: main-declarations-modern-slavery
Choose a base branch
from

Conversation

ttbarnes
Copy link
Contributor

@ttbarnes ttbarnes commented Dec 13, 2024

⚠️ WIP

⚠️ TODO

  • Data structure has changed since this was created.
  • Fix foreign key constraint issue.
  • Update README.

Introduction ✏️

This PR adds a data migration script so that when main-declarations-modern-slavery is deployed, we can migrate previous applications data structure into the new data structure required for "declarations - modern slavery".

Resolution ✔️

  • Create data migration V3 to V4 index script.
  • Create migration helper functions:
    • getAllDeclarationModernSlaveries
    • getAllDeclarations
  • Move getAllSubmittedApplications and createCuid into a new parent helpers directory to be DRY.
  • Create various migration functions so that when run, the following happens:
    • Application table - migratedFrom the V2->V3 field is replaced with a V3->V4 field.
    • A new DeclarationModernSlavery table is created.
    • A new DeclarationModernSlaveryVersion table is created.
    • For each existing declaration row (regardless of the application status), create DeclarationModernSlavery and DeclarationModernSlaveryVersion rows.
    • The Declaration table is updated appropriately.
    • Keys and constraints are added appropriately to the new tables.

Miscellaneous ➕

  • Minor documentation fixes/improvements.

@ttbarnes ttbarnes added feature New functionality tech Technical debt/improvements chore Chore labels Dec 13, 2024
@ttbarnes ttbarnes self-assigned this Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Chore feature New functionality tech Technical debt/improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant