Skip to content

Conversation

@chasetmartin
Copy link
Collaborator

Why

This PR addresses the following problem / context:

  • Prevent dev startup from wiping and rebuilding the database on every run
  • Ensure lexicon/parameter data is available before seeding
  • Avoid duplicate seed inserts when data already exists

How

Implementation summary - the following was changed / added / removed:

  • Removed erase-and-rebuild from the dev lifespan flow in core/app.py
  • Moved lexicon/parameter initialization into the seed path since seed.py errors if lexicon does not exist
  • Added a “skip if data exists” guard to seeding

Notes

Any special considerations, workarounds, or follow-up work to note?

  • Seeding now no-ops if a single contact exist; adjust the guard if a different table is preferred

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves the development environment startup by preventing unnecessary database rebuilds and ensuring proper initialization order. The changes allow developers to restart the application without losing existing data while still supporting fresh database seeding when needed.

Changes:

  • Removed automatic database wipe on development startup
  • Added prerequisite checks to ensure lexicon/parameter data exists before seeding
  • Implemented conditional seeding that skips if data already exists

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
core/app.py Removed erase_and_rebuild_db() call and added skip_if_exists flag to seeding
transfers/seed.py Added prerequisite validation, existence check, and skip logic to prevent duplicate seeds

Copilot AI review requested due to automatic review settings January 14, 2026 17:26
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@chasetmartin
Copy link
Collaborator Author

@jirhiker Ok print statements added and I changed the function name as suggested.

@jirhiker jirhiker merged commit 1f083d3 into staging Jan 14, 2026
3 checks passed
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