You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After setting up a django app and creating a migration using sorcery revision command, I get the following error when starting django dev server:
Exception in thread django-main-thread:
Traceback (most recent call last):
File "C:\Users\mi\AppData\Local\Programs\Python\Python37\lib\threading.py", line 917, in _bootstrap_inner
self.run()
File "C:\Users\mi\AppData\Local\Programs\Python\Python37\lib\threading.py", line 865, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\mi\AppData\Local\Programs\Python\Python37\lib\site-packages\django\utils\autoreload.py", line 54, in wrapper
fn(*args, **kwargs)
File "C:\Users\mi\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\management\commands\runserver.py", line 120, in inner_run
self.check_migrations()
File "C:\Users\mi\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\management\base.py", line 453, in check_migrations
executor = MigrationExecutor(connections[DEFAULT_DB_ALIAS])
File "C:\Users\mi\AppData\Local\Programs\Python\Python37\lib\site-packages\django\db\migrations\executor.py", line 18, in __init__
self.loader = MigrationLoader(self.connection)
File "C:\Users\mi\AppData\Local\Programs\Python\Python37\lib\site-packages\django\db\migrations\loader.py", line 49, in __init__
self.build_graph()
File "C:\Users\mi\AppData\Local\Programs\Python\Python37\lib\site-packages\django\db\migrations\loader.py", line 206, in build_graph
self.load_disk()
File "C:\Users\mi\AppData\Local\Programs\Python\Python37\lib\site-packages\django\db\migrations\loader.py", line 119, in load_disk
"Migration %s in app %s has no Migration class" % (migration_name, app_config.label)
django.db.migrations.exceptions.BadMigrationError: Migration 0001_test in app fares has no Migration class
It appears that the migration check wants all the files in migrations folders in apps to be valid django migrations. For now I work around this by manually adding a dummy django migration to alembic migration file:
After setting up a django app and creating a migration using
sorcery revision
command, I get the following error when starting django dev server:It appears that the migration check wants all the files in
migrations
folders in apps to be valid django migrations. For now I work around this by manually adding a dummy django migration to alembic migration file:One alternative would be using a different folder, perhaps
alembic_migrations
orrevisions
to avoid confusion with django ORM migration system.The text was updated successfully, but these errors were encountered: