| 1 | --(2141:Fri,17 Apr 15:$ )-- mysql -uroot -e 'drop database django_test;create database django_test;' && ./manage.py migrate
|
|---|
| 2 | Operations to perform:
|
|---|
| 3 | Synchronize unmigrated apps: messages, staticfiles
|
|---|
| 4 | Apply all migrations: admin, contenttypes, polls, sessions, auth
|
|---|
| 5 | Synchronizing apps without migrations:
|
|---|
| 6 | Creating tables...
|
|---|
| 7 | Running deferred SQL...
|
|---|
| 8 | Installing custom SQL...
|
|---|
| 9 | Running migrations:
|
|---|
| 10 | Rendering model states... DONE
|
|---|
| 11 | Applying contenttypes.0001_initial... OK
|
|---|
| 12 | Applying auth.0001_initial... OK
|
|---|
| 13 | Applying admin.0001_initial... OK
|
|---|
| 14 | Applying contenttypes.0002_remove_content_type_name... OK
|
|---|
| 15 | Applying auth.0002_alter_permission_name_max_length... OK
|
|---|
| 16 | Applying auth.0003_alter_user_email_max_length... OK
|
|---|
| 17 | Applying auth.0004_alter_user_username_opts... OK
|
|---|
| 18 | Applying auth.0005_alter_user_last_login_null... OK
|
|---|
| 19 | Applying auth.0006_require_contenttypes_0002... OK
|
|---|
| 20 | Applying polls.0001_initial... OK
|
|---|
| 21 | Applying polls.0002_remove_choice_question...Traceback (most recent call last):
|
|---|
| 22 | File "/Users/laszlokarolyi/Work/django-test/virtualenv/lib/python3.4/site-packages/django/db/backends/utils.py", line 64, in execute
|
|---|
| 23 | return self.cursor.execute(sql, params)
|
|---|
| 24 | File "/Users/laszlokarolyi/Work/django-test/virtualenv/lib/python3.4/site-packages/django/db/backends/mysql/base.py", line 124, in execute
|
|---|
| 25 | return self.cursor.execute(query, args)
|
|---|
| 26 | File "/Users/laszlokarolyi/Work/django-test/virtualenv/lib/python3.4/site-packages/MySQLdb/cursors.py", line 220, in execute
|
|---|
| 27 | self.errorhandler(self, exc, value)
|
|---|
| 28 | File "/Users/laszlokarolyi/Work/django-test/virtualenv/lib/python3.4/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
|
|---|
| 29 | raise errorvalue
|
|---|
| 30 | File "/Users/laszlokarolyi/Work/django-test/virtualenv/lib/python3.4/site-packages/MySQLdb/cursors.py", line 209, in execute
|
|---|
| 31 | r = self._query(query)
|
|---|
| 32 | File "/Users/laszlokarolyi/Work/django-test/virtualenv/lib/python3.4/site-packages/MySQLdb/cursors.py", line 371, in _query
|
|---|
| 33 | rowcount = self._do_query(q)
|
|---|
| 34 | File "/Users/laszlokarolyi/Work/django-test/virtualenv/lib/python3.4/site-packages/MySQLdb/cursors.py", line 335, in _do_query
|
|---|
| 35 | db.query(q)
|
|---|
| 36 | File "/Users/laszlokarolyi/Work/django-test/virtualenv/lib/python3.4/site-packages/MySQLdb/connections.py", line 280, in query
|
|---|
| 37 | _mysql.connection.query(self, query)
|
|---|
| 38 | _mysql_exceptions.OperationalError: (1553, "Cannot drop index 'polls_choice_7aa0f6ee': needed in a foreign key constraint")
|
|---|
| 39 |
|
|---|
| 40 | The above exception was the direct cause of the following exception:
|
|---|
| 41 |
|
|---|
| 42 | Traceback (most recent call last):
|
|---|
| 43 | File "./manage.py", line 10, in <module>
|
|---|
| 44 | execute_from_command_line(sys.argv)
|
|---|
| 45 | File "/Users/laszlokarolyi/Work/django-test/virtualenv/lib/python3.4/site-packages/django/core/management/__init__.py", line 338, in execute_from_command_line
|
|---|
| 46 | utility.execute()
|
|---|
| 47 | File "/Users/laszlokarolyi/Work/django-test/virtualenv/lib/python3.4/site-packages/django/core/management/__init__.py", line 330, in execute
|
|---|
| 48 | self.fetch_command(subcommand).run_from_argv(self.argv)
|
|---|
| 49 | File "/Users/laszlokarolyi/Work/django-test/virtualenv/lib/python3.4/site-packages/django/core/management/base.py", line 390, in run_from_argv
|
|---|
| 50 | self.execute(*args, **cmd_options)
|
|---|
| 51 | File "/Users/laszlokarolyi/Work/django-test/virtualenv/lib/python3.4/site-packages/django/core/management/base.py", line 441, in execute
|
|---|
| 52 | output = self.handle(*args, **options)
|
|---|
| 53 | File "/Users/laszlokarolyi/Work/django-test/virtualenv/lib/python3.4/site-packages/django/core/management/commands/migrate.py", line 221, in handle
|
|---|
| 54 | executor.migrate(targets, plan, fake=fake, fake_initial=fake_initial)
|
|---|
| 55 | File "/Users/laszlokarolyi/Work/django-test/virtualenv/lib/python3.4/site-packages/django/db/migrations/executor.py", line 110, in migrate
|
|---|
| 56 | self.apply_migration(states[migration], migration, fake=fake, fake_initial=fake_initial)
|
|---|
| 57 | File "/Users/laszlokarolyi/Work/django-test/virtualenv/lib/python3.4/site-packages/django/db/migrations/executor.py", line 147, in apply_migration
|
|---|
| 58 | state = migration.apply(state, schema_editor)
|
|---|
| 59 | File "/Users/laszlokarolyi/Work/django-test/virtualenv/lib/python3.4/site-packages/django/db/migrations/migration.py", line 115, in apply
|
|---|
| 60 | operation.database_forwards(self.app_label, schema_editor, old_state, project_state)
|
|---|
| 61 | File "/Users/laszlokarolyi/Work/django-test/virtualenv/lib/python3.4/site-packages/django/db/migrations/operations/fields.py", line 121, in database_forwards
|
|---|
| 62 | schema_editor.remove_field(from_model, from_model._meta.get_field(self.name))
|
|---|
| 63 | File "/Users/laszlokarolyi/Work/django-test/virtualenv/lib/python3.4/site-packages/django/db/backends/base/schema.py", line 441, in remove_field
|
|---|
| 64 | self.execute(sql)
|
|---|
| 65 | File "/Users/laszlokarolyi/Work/django-test/virtualenv/lib/python3.4/site-packages/django/db/backends/base/schema.py", line 107, in execute
|
|---|
| 66 | cursor.execute(sql, params)
|
|---|
| 67 | File "/Users/laszlokarolyi/Work/django-test/virtualenv/lib/python3.4/site-packages/django/db/backends/utils.py", line 79, in execute
|
|---|
| 68 | return super(CursorDebugWrapper, self).execute(sql, params)
|
|---|
| 69 | File "/Users/laszlokarolyi/Work/django-test/virtualenv/lib/python3.4/site-packages/django/db/backends/utils.py", line 64, in execute
|
|---|
| 70 | return self.cursor.execute(sql, params)
|
|---|
| 71 | File "/Users/laszlokarolyi/Work/django-test/virtualenv/lib/python3.4/site-packages/django/db/utils.py", line 97, in __exit__
|
|---|
| 72 | six.reraise(dj_exc_type, dj_exc_value, traceback)
|
|---|
| 73 | File "/Users/laszlokarolyi/Work/django-test/virtualenv/lib/python3.4/site-packages/django/utils/six.py", line 658, in reraise
|
|---|
| 74 | raise value.with_traceback(tb)
|
|---|
| 75 | File "/Users/laszlokarolyi/Work/django-test/virtualenv/lib/python3.4/site-packages/django/db/backends/utils.py", line 64, in execute
|
|---|
| 76 | return self.cursor.execute(sql, params)
|
|---|
| 77 | File "/Users/laszlokarolyi/Work/django-test/virtualenv/lib/python3.4/site-packages/django/db/backends/mysql/base.py", line 124, in execute
|
|---|
| 78 | return self.cursor.execute(query, args)
|
|---|
| 79 | File "/Users/laszlokarolyi/Work/django-test/virtualenv/lib/python3.4/site-packages/MySQLdb/cursors.py", line 220, in execute
|
|---|
| 80 | self.errorhandler(self, exc, value)
|
|---|
| 81 | File "/Users/laszlokarolyi/Work/django-test/virtualenv/lib/python3.4/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
|
|---|
| 82 | raise errorvalue
|
|---|
| 83 | File "/Users/laszlokarolyi/Work/django-test/virtualenv/lib/python3.4/site-packages/MySQLdb/cursors.py", line 209, in execute
|
|---|
| 84 | r = self._query(query)
|
|---|
| 85 | File "/Users/laszlokarolyi/Work/django-test/virtualenv/lib/python3.4/site-packages/MySQLdb/cursors.py", line 371, in _query
|
|---|
| 86 | rowcount = self._do_query(q)
|
|---|
| 87 | File "/Users/laszlokarolyi/Work/django-test/virtualenv/lib/python3.4/site-packages/MySQLdb/cursors.py", line 335, in _do_query
|
|---|
| 88 | db.query(q)
|
|---|
| 89 | File "/Users/laszlokarolyi/Work/django-test/virtualenv/lib/python3.4/site-packages/MySQLdb/connections.py", line 280, in query
|
|---|
| 90 | _mysql.connection.query(self, query)
|
|---|
| 91 | django.db.utils.OperationalError: (1553, "Cannot drop index 'polls_choice_7aa0f6ee': needed in a foreign key constraint")
|
|---|
| 92 |
|
|---|