Replies: 4 comments 4 replies
-
+1 that would be very convenient. We could keep the UI close to what migrate already does: find the latest applied migration, rollback those which need to be rolled back (ie in the migration table but not in the migration files), and then run the Up migrations. That would require storing full migrations in the table instead of just hashes though. |
Beta Was this translation helpful? Give feedback.
-
It is a great tool, happy I can help
I think down migrations could be a nice addition. The one thing I'd like be be careful of is adding too much complexity. postgresql-migration is pretty simple and I think its worth trying to keep that way, within reason.
Agreed, I think that fits in nicely with the way things already work. If we use an appropriate delimiter then would not even be a need for a parser library dependency. Simply string match on the tag
I'm not 100% sure about the first point there. Is that just an example of what an
Yeah, I think we should think of various options here. Getting this right is the crucial bit of this change.
I think I see why you are saying that, but I don't think we would need to store the full SQL. The SHA ensures that the files have not been changed. So if you are running a I like the idea of this but would like to thing of & discuss a few options before anyone starts on anything. I should have some time in the next few weeks to implement some of this, so the timing is good. |
Beta Was this translation helpful? Give feedback.
-
So it seems it's been one year since the proposal and as far as I'm aware it's not been implemented has it? For lack of time, or was it decided it was not in line with the philosophy of the project? I'd quite like to use such a feature myself :) And I could probably collaborate to implementing part of it if some more hands are needed. |
Beta Was this translation helpful? Give feedback.
-
Hi, yeah it has been a bit. Its mainly time related. Its not a very hard feature but it changes args and will need a good bit of time and focus. I'm just not able to do that at the moment :(. Also as it happens I'm mostly using other external migrations tools that work across multiple languages as that has been more important in my recent projects. So for now, I have no actual plan to implement this. Sorry :( |
Beta Was this translation helpful? Give feedback.
-
Hi! I am a very satisfied user of postgresql-migration, and I wanted to thank you @andrevdm for doing the work of reviving the original tool.
I would like to suggest a design for Up/Down migrations that is close to existing tools in the space (thinking especially of dbmate¹ and Laravel²).
We can do it the "easy" way, which means that for file-based migrations we "split" the file into two sections:
These sections would be signalled with an SQL comment like with
dbmate
:In terms of user-side interface, we could call
migrate up
to combine acreatedb
,migrate init
andmigrate migrate
migrate down
(orrollback
) to rollback the latest migration, with an optional flag to specify the number of migrations to rollback from the last, and maybe an optional flag to specify a particular migration to rollback.What do you say?
Beta Was this translation helpful? Give feedback.
All reactions