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

AttributeError: You are in a dry run, and cannot access the ORM. #7

Open
arthurzenika opened this issue Dec 3, 2016 · 0 comments
Open

Comments

@arthurzenika
Copy link

$ ./bin/django migrate --settings=settings
Running migrations for cm:
 - Migrating forwards to 0011_auto__add_field_comment_category.
 > cm:0003_update_keys_to_textversion
Traceback (most recent call last):
  File "./bin/django", line 40, in <module>
    sys.exit(djangorecipe.manage.main('cm.settings'))
  File "/home/coment/comt/eggs/djangorecipe-1.11-py2.7.egg/djangorecipe/manage.py", line 9, in main
    management.execute_from_command_line(sys.argv)
  File "/home/coment/comt/eggs/Django-1.3-py2.7.egg/django/core/management/__init__.py", line 429, in execute_from_command_line
    utility.execute()
  File "/home/coment/comt/eggs/Django-1.3-py2.7.egg/django/core/management/__init__.py", line 379, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/coment/comt/eggs/Django-1.3-py2.7.egg/django/core/management/base.py", line 191, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/home/coment/comt/eggs/Django-1.3-py2.7.egg/django/core/management/base.py", line 220, in execute
    output = self.handle(*args, **options)
  File "/home/coment/comt/src/cm/monkey_patches.py", line 62, in new_handle
    ignore_ghosts = ignore_ghosts,
  File "/home/coment/comt/eggs/South-1.0.2-py2.7.egg/south/migration/__init__.py", line 220, in migrate_app
    success = migrator.migrate_many(target, workplan, database)
  File "/home/coment/comt/eggs/South-1.0.2-py2.7.egg/south/migration/migrators.py", line 256, in migrate_many
    result = migrator.__class__.migrate_many(migrator, target, migrations, database)
  File "/home/coment/comt/eggs/South-1.0.2-py2.7.egg/south/migration/migrators.py", line 331, in migrate_many
    result = self.migrate(migration, database)
  File "/home/coment/comt/eggs/South-1.0.2-py2.7.egg/south/migration/migrators.py", line 133, in migrate
    result = self.run(migration, database)
  File "/home/coment/comt/eggs/South-1.0.2-py2.7.egg/south/migration/migrators.py", line 113, in run
    dry_run.run_migration(migration, database)
  File "/home/coment/comt/eggs/South-1.0.2-py2.7.egg/south/migration/migrators.py", line 192, in run_migration
    self._run_migration(migration)
  File "/home/coment/comt/eggs/South-1.0.2-py2.7.egg/south/migration/migrators.py", line 178, in _run_migration
    raise exceptions.FailedDryRun(migration, sys.exc_info())
south.exceptions.FailedDryRun:  ! Error found during dry run of '0003_update_keys_to_textversion'! Aborting.
Traceback (most recent call last):
  File "/home/coment/comt/eggs/South-1.0.2-py2.7.egg/south/migration/migrators.py", line 175, in _run_migration
    migration_function()
  File "/home/coment/comt/eggs/South-1.0.2-py2.7.egg/south/migration/migrators.py", line 60, in <lambda>
    return (lambda: direction(orm))
  File "/home/coment/comt/src/cm/migrations/0003_update_keys_to_textversion.py", line 11, in forwards
    for tv in orm.TextVersion.objects.all():
  File "/home/coment/comt/eggs/South-1.0.2-py2.7.egg/south/orm.py", line 402, in __getattr__
    raise AttributeError("You are in a dry run, and cannot access the ORM.\nWrap ORM sections in 'if not db.dry_run:', or if the whole migration is only a data migration, set no_dry_run = True on the Migration class.")
AttributeError: You are in a dry run, and cannot access the ORM.
Wrap ORM sections in 'if not db.dry_run:', or if the whole migration is only a data migration, set no_dry_run = True on the Migration class.
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

1 participant