{{{
Operations to perform:
Apply all migrations: history
Running migrations:
Applying history.0002_employeehitmodel...Traceback (most recent call
last):
File "./manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/usr/local/lib/python2.7/dist-
packages/django/core/management/__init__.py", line 385, in
execute_from_command_line
utility.execute()
File "/usr/local/lib/python2.7/dist-
packages/django/core/management/__init__.py", line 377, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python2.7/dist-
packages/django/core/management/base.py", line 288, in run_from_argv
self.execute(*args, **options.__dict__)
File "/usr/local/lib/python2.7/dist-
packages/django/core/management/base.py", line 338, in execute
output = self.handle(*args, **options)
File "/usr/local/lib/python2.7/dist-
packages/django/core/management/commands/migrate.py", line 160, in handle
executor.migrate(targets, plan, fake=options.get("fake", False))
File "/usr/local/lib/python2.7/dist-
packages/django/db/migrations/executor.py", line 63, in migrate
self.apply_migration(migration, fake=fake)
File "/usr/local/lib/python2.7/dist-
packages/django/db/migrations/executor.py", line 97, in apply_migration
migration.apply(project_state, schema_editor)
File "/usr/local/lib/python2.7/dist-
packages/django/db/backends/schema.py", line 82, in __exit__
self.execute(sql)
File "/usr/local/lib/python2.7/dist-
packages/django/db/backends/schema.py", line 98, in execute
cursor.execute(sql, params)
File "/usr/local/lib/python2.7/dist-
packages/django/db/backends/utils.py", line 65, in execute
return self.cursor.execute(sql, params)
File "/usr/local/lib/python2.7/dist-
packages/django/db/backends/mysql/base.py", line 128, in execute
return self.cursor.execute(query, args)
File "/usr/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 174, in
execute
self.errorhandler(self, exc, value)
File "/usr/lib/python2.7/dist-packages/MySQLdb/connections.py", line 36,
in defaulterrorhandler
raise errorclass, errorvalue
django.db.utils.OperationalError: (1005, "Can't create table 'munibase
.#sql-3c75_11a6a' (errno: 150)")
digitalice@munibase:/srv/bondfaces/bondfaces$ ./manage.py migrate history
Operations to perform:
Apply all migrations: history
Running migrations:
Applying history.0002_employeehitmodel...Traceback (most recent call
last):
File "./manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/usr/local/lib/python2.7/dist-
packages/django/core/management/__init__.py", line 385, in
execute_from_command_line
utility.execute()
File "/usr/local/lib/python2.7/dist-
packages/django/core/management/__init__.py", line 377, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python2.7/dist-
packages/django/core/management/base.py", line 288, in run_from_argv
self.execute(*args, **options.__dict__)
File "/usr/local/lib/python2.7/dist-
packages/django/core/management/base.py", line 338, in execute
output = self.handle(*args, **options)
File "/usr/local/lib/python2.7/dist-
packages/django/core/management/commands/migrate.py", line 160, in handle
executor.migrate(targets, plan, fake=options.get("fake", False))
File "/usr/local/lib/python2.7/dist-
packages/django/db/migrations/executor.py", line 63, in migrate
self.apply_migration(migration, fake=fake)
File "/usr/local/lib/python2.7/dist-
packages/django/db/migrations/executor.py", line 97, in apply_migration
migration.apply(project_state, schema_editor)
File "/usr/local/lib/python2.7/dist-
packages/django/db/migrations/migration.py", line 107, in apply
operation.database_forwards(self.app_label, schema_editor,
project_state, new_state)
File "/usr/local/lib/python2.7/dist-
packages/django/db/migrations/operations/models.py", line 36, in
database_forwards
schema_editor.create_model(model)
File "/usr/local/lib/python2.7/dist-
packages/django/db/backends/schema.py", line 270, in create_model
self.execute(sql, params)
File "/usr/local/lib/python2.7/dist-
packages/django/db/backends/schema.py", line 98, in execute
cursor.execute(sql, params)
File "/usr/local/lib/python2.7/dist-
packages/django/db/backends/utils.py", line 65, in execute
return self.cursor.execute(sql, params)
File "/usr/local/lib/python2.7/dist-packages/django/db/utils.py", line
94, in __exit__
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/usr/local/lib/python2.7/dist-
packages/django/db/backends/utils.py", line 65, in execute
return self.cursor.execute(sql, params)
File "/usr/local/lib/python2.7/dist-
packages/django/db/backends/mysql/base.py", line 128, in execute
return self.cursor.execute(query, args)
File "/usr/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 174, in
execute
self.errorhandler(self, exc, value)
File "/usr/lib/python2.7/dist-packages/MySQLdb/connections.py", line 36,
in defaulterrorhandler
raise errorclass, errorvalue
django.db.utils.OperationalError: (1050, "Table 'history_employeehitmodel'
already exists")
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/23565>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => closed
* needs_docs: => 0
* resolution: => invalid
* needs_tests: => 0
* needs_better_patch: => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/23565#comment:1>
Comment (by gregplaysguitar):
Curious, why was this closed? I've just struck the same thing trying to
add a manytomany field to an existing model.
--
Ticket URL: <https://code.djangoproject.com/ticket/23565#comment:2>
Comment (by timgraham):
Looks to me like the issue might have been what's described in
[https://docs.djangoproject.com/en/1.7/topics/migrations/#upgrading-from-
south Upgrading from South]:
The only complication is if you have a circular dependency loop of
foreign keys; in this case, makemigrations might make more than one
initial migration, and you’ll need to mark them all as applied using:
`python manage.py migrate --fake yourappnamehere`
--
Ticket URL: <https://code.djangoproject.com/ticket/23565#comment:3>
Old description:
> Here is what happened:
>
New description:
Here is what happened:
django.db.utils.OperationalError: (1005, "Can't create table 'website
.#sql-3c75_11a6a' (errno: 150)")
digitalice@website:/srv/site/site$ ./manage.py migrate history
--
--
Ticket URL: <https://code.djangoproject.com/ticket/23565#comment:4>