Replies: 3 comments 3 replies
-
This is a good idea. I'm going to be refactoring the migrations component so it can be a Go API, and I'll take a look at this after. We're going to start tracking feature requests as GitHub discussions, so I'm going to convert this issue to one. Anyone finding this: use the upvote reactji if you'd find this useful to help us prioritize. |
Beta Was this translation helpful? Give feedback.
-
I have an update here: my team integrated The check that runs in the CI job is (approximately): make restart-postgresql
river migrate-down \
--max-steps 1000 \
--database-url 'postgres://...?search_path=riverqueue'
river migrate-up \
--database-url 'postgres://...?search_path=riverqueue'
pg_dump \
--no-owner --no-privileges --schema-only \
'postgres://...' \
> ./migrations/latest.sql
# Make sure the schema is unchanged
git diff HEAD ./migrations/latest.sql And we only run it (in GitHub Actions) if: on:
pull_request:
branches:
- main
paths:
- .github/workflows/riverqueue-check-migrations.yaml
- vendor/github.com/riverqueue/** So this is making sure that our schema (in To actually make sure the |
Beta Was this translation helpful? Give feedback.
-
@dhermes The lastest version of River/River CLI, 0.0.17, just shipped with |
Beta Was this translation helpful? Give feedback.
-
Reading https://riverqueue.com/docs/migrations I'm struck by the fact that it may be hard (over time) to figure out if the version of the schema I'm running in my database matches the schema expected by the version
river
that I've got in mygo.mod
/go.sum
.I also think having
river validate
would make it much easier for teams like mine to integrate this into our existing migrations workflow. I.e. we could runriver validate
in CI and during development and detect if our existing migrations sequence needs to be updated.(I don't think it'd be the end of the world to add
river migrate-up
during deploy right next to ourmigrate up
command. However, having the two work together during development is preferable to having two "migrations managers" running during our deploys.)Beta Was this translation helpful? Give feedback.
All reactions