-
Notifications
You must be signed in to change notification settings - Fork 176
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
Allow 'Down' migrations in .sql files #530
Conversation
This commit allows SQL files to have down migrations via comments. Anything below `-- Up migration` will be treated as `up`, anything below a `-- Down migration` will be treated as `down`. A migration file can have either or both.
I would do three things:
|
👍
👍
What do you mean? -- up migration
insert into ...
-- down migration
-- nothing to do Do you think that should fail? Why? |
It should keep current behavior. Where you can't run down migrations on SQL files. |
I'm still a little bit confused (and my english skills lags 😅) I totally understand that we can't infer down migrations from up migrations, this wasn't my point |
I'm probably describing it wrong. It should fail if running down migrations and there is no down migration comment. |
OK I dont think so -- up migration
insert into ... should work, imo edit: example 1 -- up migration
insert into ... same as example 1 insert into ... example 2 -- down migration
delete from ... example 3 -- down migration
delete from ...
-- up migration
insert into ... example 4 -- down migration
delete from ...
-- up migration |
This commit allows SQL files to have down migrations via comments.
Anything below
-- Up migration
will be treated asup
, anythingbelow a
-- Down migration
will be treated asdown
.A migration file can have either or both.