-
Notifications
You must be signed in to change notification settings - Fork 89
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
feat(migrations): support for running database migrations manually #2622
Conversation
✅ Deploy Preview for brilliant-pasca-3e80ec canceled.
|
42d4eb6
to
ad4cd3c
Compare
@@ -17,6 +17,7 @@ RUN --mount=type=cache,id=pnpm,target=/pnpm/store \ | |||
FROM base AS prod-deps | |||
|
|||
COPY package.json pnpm-workspace.yaml .npmrc ./ | |||
COPY packages/auth/knexfile.js ./packages/auth/knexfile.js |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this line here is not really needed (same for packages/backend/Dockerfile
however, I like consistency (line #55)
ad4cd3c
to
1213094
Compare
This PR has been approved, however, I am not authorized to merge this pull request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Changes proposed in this pull request
ENABLE_MANUAL_MIGRATIONS
through which end user can decide if he/she wants to run migrations automatically (default flow as it always was) or manually (pnpm run knex -- migrate:latest --env production
knexfile.js
use env variable from the ENV for setting connection string for production environmentWith this in place, if Rafiki is installed on kubernetes cluster, it is possible to leverage initContainers for database migrations. This should be backward compatible or in other words, should not change how Rafiki deals with database migrations when default values for this environment variable is set.
Context
fixes #2621
After this PR is merged, we will need to implement this ENV into helm charts. After this ENV is added to helm charts, we need to set value to
true
, and we will also need to specify initContainer that will run this migrations "manually" or in other words, automatically in initContainer.Checklist
fixes #number