SmileyChris/easy-thumbnails — Issue #105: Issue running migrations on MySQL
Author: adamfeuer
Created: 2012-01-02 22:00:51+00:00
State: open

Hi, I'm getting an exception when running migrations after a fresh install and a syncdb:

```
python manage.py migrate --settings=conf.dev.settings
Running migrations for easy_thumbnails:
- Migrating forwards to 0015_auto__del_unique_thumbnail_name_storage_hash__add_unique_thumbnail_sou.
> easy_thumbnails:0005_storage_fks_null
! Error found during real run of migration! Aborting.

! Since you have a database that does not support running
! schema-altering statements in transactions, we have had
! to leave it in an interim state between migrations.

! You *might* be able to recover with:
! The South developers regret this has happened, and would
! like to gently persuade you to consider a slightly
! easier-to-deal-with DBMS.
! NOTE: The error which caused the migration to fail is further up.
Traceback (most recent call last):
File "manage.py", line 12, in
execute_manager(settings)
File "/Users/adamf/.virtualenvs/surveytool/lib/python2.7/site-packages/django/core/management/__init__.py", line 438, in execute_manager
utility.execute()
File "/Users/adamf/.virtualenvs/surveytool/lib/python2.7/site-packages/django/core/management/__init__.py", line 379, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/Users/adamf/.virtualenvs/surveytool/lib/python2.7/site-packages/django/core/management/base.py", line 191, in run_from_argv
self.execute(*args, **options.__dict__)
File "/Users/adamf/.virtualenvs/surveytool/lib/python2.7/site-packages/django/core/management/base.py", line 220, in execute
output = self.handle(*args, **options)
File "/Users/adamf/.virtualenvs/surveytool/lib/python2.7/site-packages/south/management/commands/migrate.py", line 105, in handle
ignore_ghosts = ignore_ghosts,
File "/Users/adamf/.virtualenvs/surveytool/lib/python2.7/site-packages/south/migration/__init__.py", line 191, in migrate_app
success = migrator.migrate_many(target, workplan, database)
File "/Users/adamf/.virtualenvs/surveytool/lib/python2.7/site-packages/south/migration/migrators.py", line 221, in migrate_many
result = migrator.__class__.migrate_many(migrator, target, migrations, database)
File "/Users/adamf/.virtualenvs/surveytool/lib/python2.7/site-packages/south/migration/migrators.py", line 292, in migrate_many
result = self.migrate(migration, database)
File "/Users/adamf/.virtualenvs/surveytool/lib/python2.7/site-packages/south/migration/migrators.py", line 125, in migrate
result = self.run(migration)
File "/Users/adamf/.virtualenvs/surveytool/lib/python2.7/site-packages/south/migration/migrators.py", line 99, in run
return self.run_migration(migration)
File "/Users/adamf/.virtualenvs/surveytool/lib/python2.7/site-packages/south/migration/migrators.py", line 81, in run_migration
migration_function()
File "/Users/adamf/.virtualenvs/surveytool/lib/python2.7/site-packages/south/migration/migrators.py", line 57, in
return (lambda: direction(orm))
File "/Users/adamf/.virtualenvs/surveytool/lib/python2.7/site-packages/easy_thumbnails/migrations/0005_storage_fks_null.py", line 12, in forwards
db.alter_column('easy_thumbnails_source', 'storage_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['easy_thumbnails.Storage'], null=True))
File "/Users/adamf/.virtualenvs/surveytool/lib/python2.7/site-packages/south/db/generic.py", line 397, in alter_column
field.rel.to._meta.get_field(field.rel.field_name).column
File "/Users/adamf/.virtualenvs/surveytool/lib/python2.7/site-packages/south/db/generic.py", line 150, in execute
cursor.execute(sql, params)
File "/Users/adamf/.virtualenvs/surveytool/lib/python2.7/site-packages/django/db/backends/util.py", line 34, in execute
return self.cursor.execute(sql, params)
File "/Users/adamf/.virtualenvs/surveytool/lib/python2.7/site-packages/django/db/backends/mysql/base.py", line 86, in execute
return self.cursor.execute(query, args)
File "/Users/adamf/.virtualenvs/surveytool/lib/python2.7/site-packages/MySQLdb/cursors.py", line 174, in execute
self.errorhandler(self, exc, value)
File "/Users/adamf/.virtualenvs/surveytool/lib/python2.7/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
raise errorclass, errorvalue
_mysql_exceptions.OperationalError: (1005, "Can't create table 'surveytool.#sql-3d18_c' (errno: 121)")
```