-
Notifications
You must be signed in to change notification settings - Fork 86
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
Migration failed, keyerror, migrator.orm is empty #163
Comments
Prettier output: https://pastebin.com/Dtnfey8S |
Same issue |
Looks like the issue happens because of some imports. I know that there is an issue with relative imports, so it fails while compiling migration file code with something like
@simse make sure your code is fine. I'm not sure if Probably the related thing to start from is |
@revolter this package seems to not being supported now, so if you are interested in it check https://github.com/spumer/peewee_migrate2 |
I'm trying to add a field using the following code:
migrator.add_fields('Script', 'cron')
This is the ouput:
Migration failed: 001_add_cron Traceback (most recent call last): File "/mnt/c/Users/Simon Sorensen/Documents/GitHub/chronos/.venv/lib/python3.6/site-packages/peewee_migrate/router.py", line 153, in run_one migrate(migrator, self.database, fake=fake) File "<string>", line 39, in migrate File "/mnt/c/Users/Simon Sorensen/Documents/GitHub/chronos/.venv/lib/python3.6/site-packages/peewee_migrate/migrator.py", line 105, in wrapper return method(migrator, migrator.orm[model], *args, **kwargs) KeyError: 'Script' Traceback (most recent call last): File "chronos.py", line 9, in <module> from chronos.runtime import * File "/mnt/c/Users/Simon Sorensen/Documents/GitHub/chronos/chronos/runtime.py", line 10, in <module> import chronos.metadata File "/mnt/c/Users/Simon Sorensen/Documents/GitHub/chronos/chronos/metadata.py", line 57, in <module> router.run() File "/mnt/c/Users/Simon Sorensen/Documents/GitHub/chronos/.venv/lib/python3.6/site-packages/peewee_migrate/router.py", line 182, in run self.run_one(mname, migrator, fake=fake, force=fake) File "/mnt/c/Users/Simon Sorensen/Documents/GitHub/chronos/.venv/lib/python3.6/site-packages/peewee_migrate/router.py", line 153, in run_one migrate(migrator, self.database, fake=fake) File "<string>", line 39, in migrate File "/mnt/c/Users/Simon Sorensen/Documents/GitHub/chronos/.venv/lib/python3.6/site-packages/peewee_migrate/migrator.py", line 105, in wrapper return method(migrator, migrator.orm[model], *args, **kwargs) KeyError: 'Script'
It looks like
migrator.orm
is empty. What am I doing wrong?The text was updated successfully, but these errors were encountered: