Skip to content
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

How are migrations supposed to be automatically created? #114

Open
revolter opened this issue Nov 7, 2018 · 3 comments
Open

How are migrations supposed to be automatically created? #114

revolter opened this issue Nov 7, 2018 · 3 comments

Comments

@revolter
Copy link

revolter commented Nov 7, 2018

It always creates empty migrate and rollback methods.

@Behoston
Copy link

Behoston commented Jan 1, 2019

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
Copy link

tombh commented Dec 26, 2019

Why isn't this in the README!!?

@Alexqwesa
Copy link

Alexqwesa commented Oct 29, 2024

Why isn't this in the README!!?

after 5 years!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants