How are migrations supposed to be automatically created?
revolter opened this issue · comments
Iulian Onofrei commented
It always creates empty migrate
and rollback
methods.
Mateusz Legięcki commented
It's an issue with --auto
flag wich is treated as flag but should be path to module (probaly previous version of click allows that). You need to use --auto-source
flag and point to package.
- project_name
- project_name
- app
- models
- migrations
- conf.py (contains DATABASE variable imported from models)
- requirements
In this case, you should use in root dir:
export PYTHONPATH=/home/revolter/project_name/
pw_migrate create --auto --auto-source=project_name --directory=./project_name/migrations initial
If you have problem with imports, you should:
export PYTHONPATH=/home/revolter/project_name/:/home/revolter/project_name/project_name/
Thomas Buckley-Houston commented
Why isn't this in the README!!?