peewee_migrate icon indicating copy to clipboard operation
peewee_migrate copied to clipboard

How are migrations supposed to be automatically created?

Open revolter opened this issue 7 years ago • 3 comments

It always creates empty migrate and rollback methods.

revolter avatar Nov 07 '18 22:11 revolter

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/

Behoston avatar Jan 01 '19 21:01 Behoston

Why isn't this in the README!!?

tombh avatar Dec 26 '19 05:12 tombh