Database first approach #836
Unanswered
jstachera
asked this question in
Usage Questions
Replies: 1 comment
-
hey there - there is an example of this usage here: note also that you can reflect an entire you could also achieve this within the autogenerate process itself, by using There's some other ways to do this too, but that first one should get you most of what you need. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is there any way to generate model classes from the existing database (in .net core ef this is called scaffolding).
I was not able to find any documentation about that.
When i try to use this command:
alembic revision --autogenerate -m "Base revision"
It will generate the migration with downgrade and upgrade method but taking the empty model class as base:
from sqlalchemy.ext.declarative import declarative_base Base = declarative_base()
Thus, the migration script upgrade contains drop columns from the database and downgrade create.
My intention is to have database as a source and output in the form of generated classes for each table from the database.
Is there anything like that available in alembic?
Beta Was this translation helpful? Give feedback.
All reactions