﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
24630	Misleading/incorrect docs about RunPython and transactions	Luca Corti	priidukull	"As per #23932, I added an UUIDField to a model following the documentation at https://docs.djangoproject.com/en/1.8/howto/writing-migrations/. The database is PostgreSQL.

When running the migration I get this error:

{{{
  File ""manage.py"", line 10, in <module>
    execute_from_command_line(sys.argv)
  File ""venv/lib/python2.7/site-packages/django/core/management/__init__.py"", line 338, in execute_from_command_line
    utility.execute()
  File ""venv/lib/python2.7/site-packages/django/core/management/__init__.py"", line 330, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File ""venv/lib/python2.7/site-packages/django/core/management/base.py"", line 390, in run_from_argv
    self.execute(*args, **cmd_options)
  File ""venv/lib/python2.7/site-packages/django/core/management/base.py"", line 441, in execute
    output = self.handle(*args, **options)
  File ""venv/lib/python2.7/site-packages/django/core/management/commands/migrate.py"", line 221, in handle
    executor.migrate(targets, plan, fake=fake, fake_initial=fake_initial)
  File ""venv/lib/python2.7/site-packages/django/db/migrations/executor.py"", line 110, in migrate
    self.apply_migration(states[migration], migration, fake=fake, fake_initial=fake_initial)
  File ""venv/lib/python2.7/site-packages/django/db/migrations/executor.py"", line 147, in apply_migration
    state = migration.apply(state, schema_editor)
  File ""venv/lib/python2.7/site-packages/django/db/migrations/migration.py"", line 115, in apply
    operation.database_forwards(self.app_label, schema_editor, old_state, project_state)
  File ""venv/lib/python2.7/site-packages/django/db/migrations/operations/fields.py"", line 201, in database_forwards
    schema_editor.alter_field(from_model, from_field, to_field)
  File ""venv/lib/python2.7/site-packages/django/db/backends/base/schema.py"", line 484, in alter_field
    old_db_params, new_db_params, strict)
  File ""venv/lib/python2.7/site-packages/django/db/backends/base/schema.py"", line 637, in _alter_field
    params,
  File ""venv/lib/python2.7/site-packages/django/db/backends/base/schema.py"", line 107, in execute
    cursor.execute(sql, params)
  File ""venv/lib/python2.7/site-packages/django/db/backends/utils.py"", line 79, in execute
    return super(CursorDebugWrapper, self).execute(sql, params)
  File ""venv/lib/python2.7/site-packages/django/db/backends/utils.py"", line 64, in execute
    return self.cursor.execute(sql, params)
  File ""venv/lib/python2.7/site-packages/django/db/utils.py"", line 97, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File ""venv/lib/python2.7/site-packages/django/db/backends/utils.py"", line 64, in execute
    return self.cursor.execute(sql, params)
django.db.utils.OperationalError: cannot ALTER TABLE ""mytable"" because it has pending trigger events
}}}"	Bug	closed	Documentation	1.8	Normal	fixed	uuidfiled migrations	priidukull	Ready for checkin	1	0	0	0	0	0
