Infer migrations files from models files #497
sgaseretto
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello everyone! First of all, just started using Genie.jl and found it really awesome! I come from developing APIs in Python using packages like FastApi, SQLAlchemy and Alembic and there is only one thing that bugged me a little bit when using Genie. When following the Watch Tonight tutorial, when generating the Movie resources we had to edit both the Movie migrations file and the Movie.jl file. Having to write almost the same thing twice, defining the table in the migrations file and the structure of the model in the model file adds extra labor and makes it prompt to errors. Coming from using Django's ORM and SQLAlchemy + Alembic + SQLModel, all of this only needs to be done once when you define your Model.
And once you define the model with those ORMs, you can generate the migrations file (for example using Alembic in Python) that generates the migration files with all the columns defined in the model, then when the model is modified (for example, props/columns are added or deleted), you can generate the new migrations that applies the changes to the table in the database.
I'm very new to Genie, so I don't know if this functionality is already supported, but after reading the docs couldn't find how to do it. If there isn't a way today to do this, is there any plans on adding this functionality? What are the main difficulties and challenges that need to be solved in order to have this functionality?
Beta Was this translation helpful? Give feedback.
All reactions