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: use pg for new migrations #1363

Draft
wants to merge 48 commits into
base: master
Choose a base branch
from

Conversation

alxndrsn
Copy link
Contributor

@alxndrsn alxndrsn commented Jan 14, 2025

  • implement replacement for existing knex migrator

Blocked by

TODO

Follow-up

  • rename knex-migrator
  • move existing migrations to lib/model/migrations/legacy to dissuade creating new knex-based migrations

What has been done to verify that this works as intended?

CI

Why is this the best possible solution? Were any other approaches considered?

Could use slonik instead, but seems better to tie implementation to a lower-level library, especially given concerns about upgrading to a more recent slonik (there are large API changes) and/or possibility of moving to an alternative to slonik.

How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?

Intended effects: none
Possible effects: break production databases

Does this change require updates to the API documentation? If so, please update docs/api.yaml as part of this PR.

Shouldn't require docs changes.

Before submitting this PR, please make sure you have:

  • run make test and confirmed all checks still pass OR confirm CircleCI build passes
  • verified that any code from external sources are properly credited in comments or that everything is internally sourced

lib/bin/run-migrations.js Outdated Show resolved Hide resolved
lib/model/knexfile.js Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
lib/task/task.js Outdated Show resolved Hide resolved
test/db-migrations/utils.js Outdated Show resolved Hide resolved
alxndrsn pushed a commit to alxndrsn/odk-central-backend that referenced this pull request Feb 4, 2025
Rename lib/model/migrate.js to lib/model/knex-migrator.js.

This is preparation for deprecating the knex migrator and replacing it in getodk#1363.
@alxndrsn alxndrsn mentioned this pull request Feb 4, 2025
2 tasks
@@ -10,6 +10,9 @@
// This is a variety of functions helpful for connecting to and performing
// top-level operations with a database, like migrations.

// TODO rename e.g. legacy-knex-migrator
Copy link
Contributor Author

@alxndrsn alxndrsn Feb 4, 2025

Choose a reason for hiding this comment

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

Renamed in #1384

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