Skip to content

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

Description

@arthurzenika
$ ./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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions