klen / peewee_migrate

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

Multiple Models.py files. #139

Open Ryanb58 opened 5 years ago

Ryanb58 commented 5 years ago

Hello, I currently have a situation where I have multiple models.py files separated into their own domains and folders. I was wondering how I can get pw_migrate to auto-generate the migrations. I have tried the following with no such luck.

File Structue:

 - api
 - - migrations
 - - auth
 - - - auth
 - - - - models.py
 - - groups
 - - - groups
 - - - - models.py

I am running the following command:

pw_migrate create --auto -v --database=${DB_URL} "initial"

from the /api/ folder.. and it comes back with this error message:

Can't import models module: True

Does anyone have any suggestions or ideas?

I would be okay having migration folders/files like so:

 - api
 - - auth
 - - - auth
 - - - - models.py
 - - - migrations
 - - groups
 - - - groups
 - - - - models.py
 - - - migrations

However, I would need all the migrations to be able to be run against the same database.