-
-
Notifications
You must be signed in to change notification settings - Fork 109
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
Not able to generate migrations for existing models. #156
Comments
Hey, @geekashu, weird. I can't replicate this, weirdly it works fine for me. Anyone else with this issue? |
You can use these changes to get to migration on Mac M4 using from scratch method:
|
Hey, Thanks for the reply. Yeah, I am using M4 Pro. The above didn't work for me. # Auto-import all models in app.models
def import_models(package_name):
package = importlib.import_module(package_name)
for _, module_name, _ in pkgutil.walk_packages(package.__path__, package.__name__ + "."):
importlib.import_module(module_name)
# Load all models dynamically
import_models("app.models") |
That is good, @geekashu, do you want to open a pr with it? |
Sure, will do soon. |
Added the pull request. #167 |
I'm on Linux, both cases didn't worked to me |
This one in env.py + poetry run alembic revision --autogenerate Works to me |
Hi Team,
I have disabled
create_tables_on_start
likeapp = create_application(router=router, settings=settings, create_tables_on_start=False)
.Now on my local whenever I try to run
poetry run alembic revision --autogenerate
, it always create an empty migration file. I don't want to usecreate_all()
to create the tables in my DB, instead I want to go via the alembic migrations way and generate all the required migrations beforehand. Is there a step am I missing?I am coming from the Django world and trying to learning FastAPI using this boilerplate.
The text was updated successfully, but these errors were encountered: