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

Reset norwegian dev db on deploy #631

Merged
merged 4 commits into from
Aug 30, 2023
Merged

Reset norwegian dev db on deploy #631

merged 4 commits into from
Aug 30, 2023

Conversation

adamalfredsson
Copy link
Collaborator

I've created a cloud run job that executes prisma migrate reset, which:

  1. Resets the database
  2. Runs all migrations
  3. Seeds the database

Instead of running a migration when the dev branch is pushed, we just reset the database with seed data. We can also execute the job manually.


Tested on devices

  • Desktop 💻
  • Mobile 📱

Tests

  • All tests are running ✔️
  • Test are updated 🧪
  • Code Review 👩‍💻
  • QA 👌

Checkpoints

Check these to flag for a more thurough review, as they could be potentially breaking changes

  • Packages updated
  • Other infrastructure updated (such as node version or similar)

⏲️ Time spent on CR:

⏲️ Time spent on QA:

@adamalfredsson
Copy link
Collaborator Author

Hm, seems like there is some issue running the script though, since prisma seed calls for ts-node which doesn't exist within the container.

@adamalfredsson
Copy link
Collaborator Author

This should be fine, we'll move ts-node to dependencies so that it is installed to the container. I tried experimenting with compiling the seed script to dist, but it seemed a bit too quirky.

@fellmirr fellmirr merged commit 9511425 into master Aug 30, 2023
2 checks passed
@fellmirr fellmirr deleted the reset-norwegian-db branch August 30, 2023 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants