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

FTA to RST schema import - rework to update rows in existing database #308

Closed
5 tasks
marcellmueller opened this issue Jan 31, 2025 · 3 comments
Closed
5 tasks
Assignees
Milestone

Comments

@marcellmueller
Copy link
Contributor

marcellmueller commented Jan 31, 2025

Describe the task
Currently our import from the FTA schema to our RST schema is very basic and only works on a freshly cleared database since we run flyway_clean every time we deploy to dev. We need to look at solutions on how to update this since while we could clear the prod database each time for the MVP public site at least - this would mean a couple minutes downtime each deploy, and more downtime if something went wrong.

Longer term we may need to figure out how to only update rows if data has been updated, though that depends on our strategy for migrating users/rec techs from using FTA to using our admin site.

  • For the purpose of the MVP we would likely use some sort of 'on conflict update instead of insert'.
  • This import script is located in migrations/fta/sql/V1.0.2__fta_to_rst.sql
  • For testing this we can run our updated script against the current database in the RDS query editor

Acceptance Criteria

  • Test RST migration is stable and not cleared on every deploy
  • Every import statement is updated
  • History is tracked in history tables
  • Basic documentation on how to track history on creation of a new table is added
  • Follow up and verify this is working - check history tables over the coming days for changes (if there are any, need to confirm)
@marcellmueller marcellmueller added MVP beta Tickets that are part of the first layer of MVP planning Tech Debt labels Jan 31, 2025
@BAAlexK
Copy link
Contributor

BAAlexK commented Feb 4, 2025

can maybe do automation on migration - need to research and do some testing
consider switching to prisma (not currently using for migrations) from flyaway

@airliah airliah removed the MVP beta Tickets that are part of the first layer of MVP planning label Feb 18, 2025
@BAAlexK BAAlexK assigned mishraomp and imsunchips and unassigned mishraomp and imsunchips Feb 18, 2025
@marcellmueller marcellmueller moved this from Todo to In Progress in RST's Digital Delivery Team Feb 26, 2025
@marcellmueller marcellmueller self-assigned this Feb 26, 2025
@marcellmueller marcellmueller moved this from In Progress to Code Review in RST's Digital Delivery Team Mar 4, 2025
@BAAlexK BAAlexK added this to the RST - Beta milestone Mar 7, 2025
@marcellmueller marcellmueller moved this from Code Review to Ready to push to test in RST's Digital Delivery Team Mar 7, 2025
@marcellmueller marcellmueller moved this from Ready to push to test to PO Review in RST's Digital Delivery Team Mar 7, 2025
@airliah
Copy link

airliah commented Mar 17, 2025

@marcellmueller anything that affects what users see for this ticket, that I can review?

@marcellmueller
Copy link
Contributor Author

Not at all sorry 😅

This won't affect much of anything until we either go to prod or stop clearing the test database every deployment. After we deploy a database that we don't clear everytime (prod) then we can see historical records of any FTA data that was updated since our last import.

@airliah airliah closed this as completed Mar 17, 2025
@github-project-automation github-project-automation bot moved this from PO Review to Done in RST's Digital Delivery Team Mar 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

6 participants