{
    "extra": {
        "sys.argv": ["'./manage.py'", "'test'", "'news'", "'--settings=rhmais.settings.local_mysql'"],
        "argv": ["'./manage.py'", "'test'", "'news'", "'--settings=rhmais.settings.local_mysql'"]
    },
    "timestamp": "2015-07-18T01:00:15Z",
    "time_spent": null,
    "message": "IntegrityError: (1215, 'Cannot add foreign key constraint')",
    "exception": {
        "values": [{
            "stacktrace": {
                "frames": [{
                    "function": "new_execute",
                    "abs_path": "/Users/luccascorrea/Desenvolvimento/virt_env/env_rh/lib/python2.7/site-packages/raven/contrib/django/management/__init__.py",
                    "vars": {
                        "kwargs": {
                            "'list'": false,
                            "'interactive'": false,
                            "'database'": "'default'",
                            "u'skip_checks'": true,
                            "'no_color'": false,
                            "'app_label'": null,
                            "'fake'": false,
                            "'migration_name'": null,
                            "'traceback'": false,
                            "'test_flush'": true,
                            "'verbosity'": 0,
                            "'settings'": null,
                            "'fake_initial'": false,
                            "'pythonpath'": null,
                            "'load_initial_data'": true
                        },
                        "self": "<django.core.management.commands.migrate.Command object at 0x10ca8d4d0>",
                        "args": [],
                        "original_func": "<unbound method BaseCommand.execute>",
                        "client": "<raven.contrib.django.client.DjangoClient object at 0x10cadd550>"
                    },
                    "pre_context": ["        return False", "", "    @wraps(original_func)", "    def new_execute(self, *args, **kwargs):", "        try:"],
                    "lineno": 41,
                    "module": "raven.contrib.django.management",
                    "post_context": ["        except Exception:", "            from raven.contrib.django.models import client", "", "            client.captureException(extra={", "                'argv': sys.argv"],
                    "context_line": "            return original_func(self, *args, **kwargs)",
                    "filename": "raven/contrib/django/management/__init__.py"
                }, {
                    "function": "execute",
                    "abs_path": "/Users/luccascorrea/Desenvolvimento/virt_env/env_rh/lib/python2.7/site-packages/django/core/management/base.py",
                    "vars": {
                        "self": "<django.core.management.commands.migrate.Command object at 0x10ca8d4d0>",
                        "args": [],
                        "translation": "<module 'django.utils.translation' from '/Users/luccascorrea/Desenvolvimento/virt_env/env_rh/lib/python2.7/site-packages/django/utils/translation/__init__.pyc'>",
                        "options": {
                            "'list'": false,
                            "'interactive'": false,
                            "'database'": "'default'",
                            "u'skip_checks'": true,
                            "'no_color'": false,
                            "'app_label'": null,
                            "'fake'": false,
                            "'migration_name'": null,
                            "'traceback'": false,
                            "'test_flush'": true,
                            "'verbosity'": 0,
                            "'settings'": null,
                            "'fake_initial'": false,
                            "'pythonpath'": null,
                            "'load_initial_data'": true
                        },
                        "saved_locale": "'pt-br'"
                    },
                    "pre_context": ["        try:", "            if (self.requires_system_checks and", "                    not options.get('skip_validation') and  # Remove at the end of deprecation for `skip_validation`.", "                    not options.get('skip_checks')):", "                self.check()"],
                    "lineno": 444,
                    "module": "django.core.management.base",
                    "post_context": ["            if output:", "                if self.output_transaction:", "                    # This needs to be imported here, because it relies on", "                    # settings.", "                    from django.db import connections, DEFAULT_DB_ALIAS"],
                    "in_app": false,
                    "context_line": "            output = self.handle(*args, **options)",
                    "filename": "django/core/management/base.py"
                }, {
                    "function": "handle",
                    "abs_path": "/Users/luccascorrea/Desenvolvimento/virt_env/env_rh/lib/python2.7/site-packages/django/core/management/commands/migrate.py",
                    "vars": {
                        "run_syncdb": true,
                        "args": [],
                        "db": "'default'",
                        "app_config": "<RavenConfig: raven_contrib_django>",
                        "plan": [
                            ["<Migration contenttypes.0001_initial>", false],
                            ["<Migration auth.0001_initial>", false],
                            ["<Migration accounts.0001_initial>", false],
                            ["<Migration accounts.0002_employeetypeuseremployee_useremployeedepartment>", false],
                            ["<Migration accounts.0003_auto_20150428_1105>", false],
                            ["<Migration accounts.0004_auto_20150520_1526>", false],
                            ["<Migration accounts.0005_auto_20150527_1738>", false],
                            ["<Migration accounts.0006_auto_20150618_0837>", false],
                            ["<Migration accounts.0007_auto_20150715_2000>", false],
                            ["<Migration admin.0001_initial>", false],
                            ["<Migration contenttypes.0002_remove_content_type_name>", false],
                            ["<Migration auth.0002_alter_permission_name_max_length>", false],
                            ["<Migration auth.0003_alter_user_email_max_length>", false],
                            ["<Migration auth.0004_alter_user_username_opts>", false],
                            ["<Migration auth.0005_alter_user_last_login_null>", false],
                            ["<Migration auth.0006_require_contenttypes_0002>", false],
                            ["<Migration bulletins.0001_initial>", false],
                            ["<Migration bulletins.0002_auto_20150527_1738>", false],
                            ["<Migration messaging.0001_initial>", false],
                            ["<Migration messaging.0002_auto_20150611_1509>", false],
                            ["<Migration messaging.0003_conversation_isanonymous>", false],
                            ["<Migration messaging.0004_auto_20150616_1120>", false],
                            ["<Migration messaging.0005_auto_20150616_1424>", false],
                            ["<Migration messaging.0006_auto_20150618_0837>", false],
                            ["<Migration messaging.0007_conversationdeleted_conversationtodelete_conversationtosend>", false],
                            ["<Migration messaging.0008_conversation_isadmin>", false],
                            ["<Migration messaging.0009_auto_20150713_1037>", false],
                            ["<Migration messaging.0010_auto_20150714_1955>", false],
                            ["<Migration messaging.0011_conversation_isenabled>", false],
                            ["<Migration messaging.0012_auto_20150715_1356>", false],
                            ["<Migration messaging.0013_remove_conversation_isenabled>", false],
                            ["<Migration news.0001_initial>", false],
                            ["<Migration news.0002_auto_20150504_1758>", false],
                            ["<Migration news.0003_auto_20150504_1844>", false],
                            ["<Migration news.0004_auto_20150504_1849>", false],
                            ["<Migration sessions.0001_initial>", false],
                            ["<Migration surveys.0001_initial>", false],
                            ["<Migration surveys.0002_auto_20150602_1109>", false],
                            ["<Migration surveys.0003_surveytodelete>", false]
                        ],
                        "conflicts": {},
                        "targets": [
                            ["'accounts'", "u'0007_auto_20150715_2000'"],
                            ["'admin'", "u'0001_initial'"],
                            ["'auth'", "u'0006_require_contenttypes_0002'"],
                            ["'bulletins'", "u'0002_auto_20150527_1738'"],
                            ["'contenttypes'", "u'0002_remove_content_type_name'"],
                            ["'messaging'", "u'0013_remove_conversation_isenabled'"],
                            ["'news'", "u'0004_auto_20150504_1849'"],
                            ["'sessions'", "u'0001_initial'"],
                            ["'surveys'", "u'0003_surveytodelete'"]
                        ],
                        "self": "<django.core.management.commands.migrate.Command object at 0x10ca8d4d0>",
                        "connection": "<django.db.backends.mysql.base.DatabaseWrapper object at 0x10c1c9190>",
                        "executor": "<django.db.migrations.executor.MigrationExecutor object at 0x10ca8da50>",
                        "options": {
                            "'list'": false,
                            "'interactive'": false,
                            "'database'": "'default'",
                            "u'skip_checks'": true,
                            "'no_color'": false,
                            "'app_label'": null,
                            "'fake'": false,
                            "'migration_name'": null,
                            "'traceback'": false,
                            "'test_flush'": true,
                            "'verbosity'": 0,
                            "'settings'": null,
                            "'fake_initial'": false,
                            "'pythonpath'": null,
                            "'load_initial_data'": true
                        },
                        "target_app_labels_only": true
                    },
                    "pre_context": ["        # Note that pre_migrate is called from inside here, as it needs", "        # the list of models about to be installed.", "        if run_syncdb and executor.loader.unmigrated_apps:", "            if self.verbosity >= 1:", "                self.stdout.write(self.style.MIGRATE_HEADING(\"Synchronizing apps without migrations:\"))"],
                    "lineno": 179,
                    "module": "django.core.management.commands.migrate",
                    "post_context": ["        else:", "            created_models = []", "            emit_pre_migrate_signal([], self.verbosity, self.interactive, connection.alias)", "", "        # The test runner requires us to flush after a syncdb but before migrations,"],
                    "in_app": false,
                    "context_line": "            created_models = self.sync_apps(connection, executor.loader.unmigrated_apps)",
                    "filename": "django/core/management/commands/migrate.py"
                }, {
                    "function": "sync_apps",
                    "abs_path": "/Users/luccascorrea/Desenvolvimento/virt_env/env_rh/lib/python2.7/site-packages/django/core/management/commands/migrate.py",
                    "vars": {
                        "tables": ["u'django_migrations'"],
                        "app_labels": ["'e89_push_messaging'", "'raven_contrib_django'", "'staticfiles'", "'e89_tools'", "'messages'", "'e89_syncing'", "'widget_tweaks'", "'e89_beta_testing'", "'rest_framework'"],
                        "app_name": "'raven_contrib_django'",
                        "all_models": [
                            ["'rest_framework'", []],
                            ["'e89_syncing'", ["<class 'e89_syncing.models.SyncLog'>"]],
                            ["'e89_tools'", ["<class 'e89_tools.models.KeyValueStore'>"]],
                            ["'e89_push_messaging'", ["<class 'e89_push_messaging.models.Device'>"]],
                            ["'e89_beta_testing'", ["<class 'e89_beta_testing.models.BetaTester'>", "<class 'e89_beta_testing.models.IphoneBetaApp'>"]],
                            ["'widget_tweaks'", []],
                            ["'raven_contrib_django'", []]
                        ],
                        "self": "<django.core.management.commands.migrate.Command object at 0x10ca8d4d0>",
                        "created_models": ["<class 'e89_beta_testing.models.IphoneBetaApp'>", "<class 'e89_beta_testing.models.BetaTester'>", "<class 'e89_tools.models.KeyValueStore'>", "<class 'e89_syncing.models.SyncLog'>", "<class 'e89_push_messaging.models.Device'>"],
                        "cursor": "<django.db.backends.utils.CursorWrapper object at 0x10cadd410>",
                        "connection": "<django.db.backends.mysql.base.DatabaseWrapper object at 0x10c1c9190>",
                        "model_installed": "<function model_installed from django.core.management.commands.migrate at 0x10ca936e0>",
                        "app_config": "<RavenConfig: raven_contrib_django>",
                        "editor": "<django.db.backends.mysql.schema.DatabaseSchemaEditor object at 0x10cadd590>",
                        "statement": "u'ALTER TABLE `e89_syncing_synclog` ADD CONSTRAINT `e89_syncing_user_id_670069ad1cf9eaae_fk_accounts_useremployee_id` FOREIGN KEY (`user_id`) REFERENCES `accounts_useremployee` (`id`)'",
                        "create_models": ["<class 'e89_beta_testing.models.IphoneBetaApp'>", "<class 'e89_beta_testing.models.BetaTester'>", "<class 'e89_tools.models.KeyValueStore'>", "<class 'e89_syncing.models.SyncLog'>", "<class 'e89_push_messaging.models.Device'>"],
                        "deferred_sql": ["u'ALTER TABLE `e89_syncing_synclog` ADD CONSTRAINT `e89_syncing_user_id_670069ad1cf9eaae_fk_accounts_useremployee_id` FOREIGN KEY (`user_id`) REFERENCES `accounts_useremployee` (`id`)'", "u'ALTER TABLE `e89_push_messaging_device` ADD CONSTRAINT `e89_push_m_owner_id_796e11e4eeab95dc_fk_accounts_useremployee_id` FOREIGN KEY (`owner_id`) REFERENCES `accounts_useremployee` (`id`)'"],
                        "model": "<class 'e89_beta_testing.models.IphoneBetaApp'>",
                        "manifest": {
                            "'e89_tools'": ["<class 'e89_tools.models.KeyValueStore'>"],
                            "'e89_beta_testing'": ["<class 'e89_beta_testing.models.BetaTester'>", "<class 'e89_beta_testing.models.IphoneBetaApp'>"],
                            "'raven_contrib_django'": [],
                            "'rest_framework'": [],
                            "'e89_syncing'": ["<class 'e89_syncing.models.SyncLog'>"],
                            "'e89_push_messaging'": ["<class 'e89_push_messaging.models.Device'>"],
                            "'widget_tweaks'": []
                        },
                        "model_list": []
                    },
                    "pre_context": ["                        created_models.add(model)", "", "                if self.verbosity >= 1:", "                    self.stdout.write(\"    Running deferred SQL...\\n\")", "                for statement in deferred_sql:"],
                    "lineno": 317,
                    "module": "django.core.management.commands.migrate",
                    "post_context": ["        finally:", "            cursor.close()", "", "        # The connection may have been closed by a syncdb handler.", "        cursor = connection.cursor()"],
                    "in_app": false,
                    "context_line": "                    cursor.execute(statement)",
                    "filename": "django/core/management/commands/migrate.py"
                }, {
                    "function": "execute",
                    "abs_path": "/Users/luccascorrea/Desenvolvimento/virt_env/env_rh/lib/python2.7/site-packages/django/db/backends/utils.py",
                    "vars": {
                        "self": "<django.db.backends.utils.CursorWrapper object at 0x10cadd410>",
                        "params": null,
                        "sql": "u'ALTER TABLE `e89_syncing_synclog` ADD CONSTRAINT `e89_syncing_user_id_670069ad1cf9eaae_fk_accounts_useremployee_id` FOREIGN KEY (`user_id`) REFERENCES `accounts_useremployee` (`id`)'"
                    },
                    "pre_context": ["        self.db.validate_no_broken_transaction()", "        with self.db.wrap_database_errors:", "            if params is None:", "                return self.cursor.execute(sql)", "            else:"],
                    "lineno": 64,
                    "module": "django.db.backends.utils",
                    "post_context": ["", "    def executemany(self, sql, param_list):", "        self.db.validate_no_broken_transaction()", "        with self.db.wrap_database_errors:", "            return self.cursor.executemany(sql, param_list)"],
                    "in_app": false,
                    "context_line": "                return self.cursor.execute(sql, params)",
                    "filename": "django/db/backends/utils.py"
                }, {
                    "function": "__exit__",
                    "abs_path": "/Users/luccascorrea/Desenvolvimento/virt_env/env_rh/lib/python2.7/site-packages/django/db/utils.py",
                    "vars": {
                        "self": "<django.db.utils.DatabaseErrorWrapper object at 0x10cac6750>",
                        "traceback": "<traceback object at 0x10cae4c20>",
                        "exc_value": "IntegrityError(1215, 'Cannot add foreign key constraint')",
                        "dj_exc_type": "<class 'django.db.utils.IntegrityError'>",
                        "dj_exc_value": "IntegrityError(1215, 'Cannot add foreign key constraint')",
                        "exc_type": "<class '_mysql_exceptions.IntegrityError'>",
                        "db_exc_type": "<class '_mysql_exceptions.IntegrityError'>"
                    },
                    "pre_context": ["                dj_exc_value.__cause__ = exc_value", "                # Only set the 'errors_occurred' flag for errors that may make", "                # the connection unusable.", "                if dj_exc_type not in (DataError, IntegrityError):", "                    self.wrapper.errors_occurred = True"],
                    "lineno": 97,
                    "module": "django.db.utils",
                    "post_context": ["", "    def __call__(self, func):", "        # Note that we are intentionally not using @wraps here for performance", "        # reasons. Refs #21109.", "        def inner(*args, **kwargs):"],
                    "in_app": false,
                    "context_line": "                six.reraise(dj_exc_type, dj_exc_value, traceback)",
                    "filename": "django/db/utils.py"
                }, {
                    "function": "execute",
                    "abs_path": "/Users/luccascorrea/Desenvolvimento/virt_env/env_rh/lib/python2.7/site-packages/django/db/backends/utils.py",
                    "vars": {
                        "self": "<django.db.backends.utils.CursorWrapper object at 0x10cadd410>",
                        "params": null,
                        "sql": "u'ALTER TABLE `e89_syncing_synclog` ADD CONSTRAINT `e89_syncing_user_id_670069ad1cf9eaae_fk_accounts_useremployee_id` FOREIGN KEY (`user_id`) REFERENCES `accounts_useremployee` (`id`)'"
                    },
                    "pre_context": ["", "    def execute(self, sql, params=None):", "        self.db.validate_no_broken_transaction()", "        with self.db.wrap_database_errors:", "            if params is None:"],
                    "lineno": 62,
                    "module": "django.db.backends.utils",
                    "post_context": ["            else:", "                return self.cursor.execute(sql, params)", "", "    def executemany(self, sql, param_list):", "        self.db.validate_no_broken_transaction()"],
                    "in_app": false,
                    "context_line": "                return self.cursor.execute(sql)",
                    "filename": "django/db/backends/utils.py"
                }, {
                    "function": "execute",
                    "abs_path": "/Users/luccascorrea/Desenvolvimento/virt_env/env_rh/lib/python2.7/site-packages/django/db/backends/mysql/base.py",
                    "vars": {
                        "query": "u'ALTER TABLE `e89_syncing_synclog` ADD CONSTRAINT `e89_syncing_user_id_670069ad1cf9eaae_fk_accounts_useremployee_id` FOREIGN KEY (`user_id`) REFERENCES `accounts_useremployee` (`id`)'",
                        "self": "<django.db.backends.mysql.base.CursorWrapper object at 0x10cadd3d0>",
                        "args": null
                    },
                    "pre_context": ["        self.cursor = cursor", "", "    def execute(self, query, args=None):", "        try:", "            # args is None means no string interpolation"],
                    "lineno": 124,
                    "module": "django.db.backends.mysql.base",
                    "post_context": ["        except Database.OperationalError as e:", "            # Map some error codes to IntegrityError, since they seem to be", "            # misclassified and Django would prefer the more logical place.", "            if e.args[0] in self.codes_for_integrityerror:", "                six.reraise(utils.IntegrityError, utils.IntegrityError(*tuple(e.args)), sys.exc_info()[2])"],
                    "in_app": false,
                    "context_line": "            return self.cursor.execute(query, args)",
                    "filename": "django/db/backends/mysql/base.py"
                }, {
                    "function": "execute",
                    "abs_path": "/Users/luccascorrea/Desenvolvimento/virt_env/env_rh/lib/python2.7/site-packages/MySQLdb/cursors.py",
                    "vars": {
                        "exc": "<class '_mysql_exceptions.IntegrityError'>",
                        "self": "<MySQLdb.cursors.Cursor object at 0x10cac6890>",
                        "args": null,
                        "db": "<weakproxy at 0x10cab6d08 to Connection at 0x7fdc2a800020>",
                        "value": "IntegrityError(1215, 'Cannot add foreign key constraint')",
                        "r": null,
                        "query": "'ALTER TABLE `e89_syncing_synclog` ADD CONSTRAINT `e89_syncing_user_id_670069ad1cf9eaae_fk_accounts_useremployee_id` FOREIGN KEY (`user_id`) REFERENCES `accounts_useremployee` (`id`)'"
                    },
                    "pre_context": ["            raise", "        except:", "            exc, value, tb = sys.exc_info()", "            del tb", "            self.messages.append((exc, value))"],
                    "lineno": 205,
                    "module": "MySQLdb.cursors",
                    "post_context": ["        self._executed = query", "        if not self._defer_warnings: self._warning_check()", "        return r", "", "    def executemany(self, query, args):"],
                    "context_line": "            self.errorhandler(self, exc, value)",
                    "filename": "MySQLdb/cursors.py"
                }, {
                    "function": "defaulterrorhandler",
                    "abs_path": "/Users/luccascorrea/Desenvolvimento/virt_env/env_rh/lib/python2.7/site-packages/MySQLdb/connections.py",
                    "vars": {
                        "errorclass": "<class '_mysql_exceptions.IntegrityError'>",
                        "errorvalue": "IntegrityError(1215, 'Cannot add foreign key constraint')",
                        "error": ["<class '_mysql_exceptions.IntegrityError'>", "IntegrityError(1215, 'Cannot add foreign key constraint')"]
                    },
                    "pre_context": ["        cursor.messages.append(error)", "    else:", "        connection.messages.append(error)", "    del cursor", "    del connection"],
                    "lineno": 36,
                    "module": "MySQLdb.connections",
                    "post_context": ["", "re_numeric_part = re.compile(r\"^(\\d+)\")", "", "def numeric_part(s):", "    \"\"\"Returns the leading numeric part of a string."],
                    "context_line": "    raise errorclass, errorvalue",
                    "filename": "MySQLdb/connections.py"
                }]
            },
            "type": "IntegrityError",
            "value": "(1215, 'Cannot add foreign key constraint')",
            "module": "django.db.utils"
        }]
    },
    "culprit": "MySQLdb.connections in defaulterrorhandler",
    "server_name": "Luccass-Mac-mini.local",
    "level": 40,
    "event_id": "8dc16194c04140f685352eeb941fb94f",
    "tags": {},
    "modules": {
        "python": "2.7.5",
        "e89_push_messaging": "1.0.5",
        "rest_framework": "3.1.0",
        "e89_beta_testing": "1.0.0",
        "e89_tools": "1.0.0",
        "raven": "5.3.1",
        "e89_syncing": "1.0.3",
        "django": "1.8.3"
    },
    "project": "25072",
    "platform": "python"
}