Skip to content

fix: npm run db:seed command runs successfully, db is populated#1477

Open
JanPhillips wants to merge 3 commits intomainfrom
fix/jan-is-having-issues-with-seed-script
Open

fix: npm run db:seed command runs successfully, db is populated#1477
JanPhillips wants to merge 3 commits intomainfrom
fix/jan-is-having-issues-with-seed-script

Conversation

@JanPhillips
Copy link
Copy Markdown
Contributor

@JanPhillips JanPhillips commented Jul 10, 2025

Describe your changes

npm run db:seed was not working within applications-service/packages/applications-service-api/, the DB was not being populated. I noticed this whilst working on a ticket related to translations for /register-of-advice, I needed some data in the database to know if the translations were working. Before I made the changes, the script was crashing because in a few places duplicate entries were being attempted/duplicated on existing fields that are meant to be unique for the table. To avoid this, instead of inserting values for foreign keys, it is connecting to the foreign that already exists.

Useful information to review or test

Type of change 🧩

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Other (please explain in the description section above)

Checklist before requesting a review

  • I have performed a self-review of my own code
  • I have double checked this work does not include any hardcoded secrets or passwords
  • I have made corresponding changes to the documentation
  • I have provided details on how I have tested my code
  • I have referenced the ticket number above
  • I have provided a description of the ticket
  • I have included unit tests to cover any testable code changes

@JanPhillips JanPhillips self-assigned this Jul 10, 2025
@kostaspins
Copy link
Copy Markdown
Contributor

There are also some other seed files ready maybe to combine them for better sampling

@JanPhillips
Copy link
Copy Markdown
Contributor Author

There are also some other seed files ready maybe to combine them for better sampling

Cool! Let's talk about this! Thank you :) I believe @DavidJWhiteDev might also have some contributions for this effort as well...

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.

3 participants