Skip to content

How can I check if versioned migrations are up to date with the schema? #2636

Closed Answered by a8m
LiquidLemon asked this question in Q&A
Discussion options

You must be logged in to vote

Note, you can also use schema diff (with custom --format) for this and fail if there are changes:

atlas schema diff \
  --from "file://migrations" \
  --to env://orm \
  --env local \
  --format '{{ if .Changes }}fail{{ end }}' | grep '.' && exit 1

(Or, you can convert it to if [ -n "$output" ]; then .. fi).

See the doc for more info: https://atlasgo.io/declarative/diff#compare-external-schemas

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by LiquidLemon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants