klen / peewee_migrate

Simple migration engine for Peewee
MIT License
355 stars 86 forks source link

How are migrations supposed to be automatically created? #114

Open revolter opened 6 years ago

revolter commented 6 years ago

It always creates empty migrate and rollback methods.

Behoston commented 5 years ago

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/
tombh commented 4 years ago

Why isn't this in the README!!?

Alexqwesa commented 3 weeks ago

Why isn't this in the README!!?

after 5 years!!!