-
Notifications
You must be signed in to change notification settings - Fork 521
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
Document "SQL migration file: must start with '-- +goose Up'" (and not goose Down) #163
Comments
Interesting, what's the use case for Down-only migrations? |
Oh, sorry, i think wasn't clear. |
no problem; send it when you're back on desktop pls |
Migration file
Spun up postgres with: docker run -p 5432:5432 -e "POSTGRES_USER=docker" -e "POSTGRES_PASSWORD=docker" -e "ALLOW_IP_RANGE=0.0.0.0/0" postgres Apply the migration: goose -dir=./migrations/ postgres "user=docker password=docker dbname=postgres sslmode=disable" up Returns:
Note that using |
Related: we had an extra space at the beginning of the file, i.e. |
@andor44 can you report this bug as a separate issue please? |
We typically don't write these files by hand, instead run something like this.. goose -dir ./some/dir/migrations create create_users_table sql But we should fix this up. The order of the up vs down directives within a file should not matter. |
For brevity, #163 (comment) about empty lines will be fixed as part of #446 |
Hi there, thanks for this great tool!
I noticed that new versions of Goose require SQL migration files to begin with the
-- +goose Up
statement. I made a few that started with-- +goose Down
instead, and these used to work fine.Couldn't find explicit mention of this in the docs. Maybe i missed something?
Thanks!
The text was updated successfully, but these errors were encountered: