-
Notifications
You must be signed in to change notification settings - Fork 346
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
Migrations #26
Comments
I prefer typed migration (activate framework like...?) |
@lastland's Scala Forklift is a framework agnostic tool to manage versions and apply migrations written in Scala. Worth checking out as a potential solution to one piece of the puzzle. |
@cvogt thanks for the pointer! :) I didn't know about forklift. |
interesting about forklift is also that it has a notion of working while developing in a world of branches ... switching the schema when switching the branch |
@cvogt Thanks for the reference! @fwbrasil Would be glad if I could help on this issue. 😄 Now Forklift makes use of And I haven't found any support for alter table operations in quill. Or did I miss something? |
@lastland, quill doesn't have support for DDLs. Let me have a look at your library in the envening so we can discuss it further. |
@lastland I think a starting point for forklift with quill would be untyped plain sql and no code generation. |
Hi, I have just implemented a prototype to demonstrate how to use Forklift to do database migrations on Quill: https://github.com/lastland/scala-forklift-quill This demo still contains some hard code and unimplemented features, but I believe it's sufficient to show how it works. Please refer to README to see how to play with it. I have also discussed a challenge there. Feel free to reach me if you have any questions. |
@lastland Thanks for putting together the example project, I'm sorry for taking so long to give you feedback on this. I was focusing on releasing the Quick question about forklift: does it support reverting the schema to previous versions (similar to ruby's up/down mechanism)? |
@fwbrasil What's your use case for down migrations? I know some frameworks offer them (I don't know about forklift), but how important are they in reality? |
@cvogt Activate provides this feature and it is very convenient, specially for very large schemas that can't be easily recreated from scratch. |
@fwbrasil Hi, Forklift does not currently support down operations. I don't know much about the down operations' real-world use cases, but I imagine (correct me if I'm wrong) the most use cases are:
For the first case one can define another migration. For the second case I think one can use the Forklift's git integration (mentioned by @cvogt before) to keep different db versions in different git branches. The git integration is not demonstrated in the example code. The basic idea is to store some information to recover the db with the git branches. The information can be a copy of the original database, a dump file, a sequence of migrations, or any other information sufficient to recover the database provided by the developer or some other libraries. You can find a bit more information here. PS: Forklift's current git integration features are only experimental and quite slow, but we plan to further explore this direction in the future. Does this make sense? |
@fwbrasil right, but in what situation would you want to go back to an older version? |
|
I see, it seems to be an alternative. I'd consider up/down migrations a better solution for both scenarios though. |
Here are a few thoughts:
|
Just curious: is it yet in progress? thanks! 🥇 |
I'd advise people to use something like |
* Implementing Cassandra UDTs * Implementing Cassanra-ZIO Context
Decide if Quill should have a migration module. If not, document the recommended library for migrations.
The text was updated successfully, but these errors were encountered: