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

db-migrations: prevent use of application code #1371

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

alxndrsn
Copy link
Contributor

Mixing application code into database migrations removes assurances that the same migration will mutate the same postgresql data identically when upgrading from/to different versions of the application.

  • add exceptions to existing use of application code in db migrations
  • discourage future use of application code in db migrations by adding an eslint rule to error for local includes outside lib/model/migrations

Mixing application code into database migrations removes assurances that the same migration will mutate the same postgresql data identically when upgrading from/to different versions of the application.

* add exceptions to existing use of application code in db migrations
* discourage future use of application code in db migrations by adding an eslint rule to error for local includes outside `lib/model/migrations`
alxndrsn pushed a commit to alxndrsn/odk-central-backend that referenced this pull request Jan 16, 2025
@alxndrsn alxndrsn requested a review from ktuite January 16, 2025 06:37
@alxndrsn
Copy link
Contributor Author

alxndrsn commented Jan 16, 2025

A low-impact example of this is shown at:

// NOTE/TODO: figure out something else here D:
// Skipping these migrations because after adding a new description
// column to projects and forms, it is not possible to migrate part way
// (before the new column) and populate the data when frames expect the
// new column to exist.

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.

1 participant