Ticket #300 (closed defect: worksforme)

Opened 6 years ago

Last modified 6 years ago

Migrate Error

Reported by: anonymous Owned by: andrew
Priority: major Milestone: 0.6.3
Component: migrations Version: 0.6.2
Keywords: Cc:


Hi I get the below error when I try to migrate data. I followed the same steps in http://south.aeracode.org/wiki/Tutorial3.
I'm getting errors for either MyISAM or InnoDB!
All what I'm trying to do is to replace two fields and migrate their data and none of the is a foreign key!

Traceback (most recent call last):
  File "/Users/mutaz/django_projects/default_project/projectslibs/south/migration.py", line 339, in run_migrations
  File "/Users/mutaz/django_projects/default_project/barakapps/blog/migrations/0001_initial.py", line 29, in forwards
    ('site', orm['blog.Post:site']),
  File "/Users/mutaz/django_projects/default_project/projectslibs/south/db/generic.py", line 168, in create_table
    self.execute('CREATE TABLE %s (%s);' % (qn(table_name), ', '.join([col for col in columns if col])))
  File "/Users/mutaz/django_projects/default_project/projectslibs/south/db/generic.py", line 86, in execute
    cursor.execute(sql, params)
  File "/Users/mutaz/django_projects/MMM/lib/python2.5/site-packages/Django-1.0.2_final-py2.5.egg/django/db/backends/util.py", line 19, in execute
    return self.cursor.execute(sql, params)
  File "/Users/mutaz/django_projects/MMM/lib/python2.5/site-packages/Django-1.0.2_final-py2.5.egg/django/db/backends/mysql/base.py", line 84, in execute
    return self.cursor.execute(query, args)
  File "build/bdist.macosx-10.5-i386/egg/MySQLdb/cursors.py", line 166, in execute
    self.errorhandler(self, exc, value)
  File "build/bdist.macosx-10.5-i386/egg/MySQLdb/connections.py", line 35, in defaulterrorhandler
    raise errorclass, errorvalue
OperationalError: (1050, "Table 'blog_post' already exists")
 ! 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:
   = DROP TABLE `blog_post` CASCADE; []

 ! The South developers regret this has happened, and would
 ! like to gently persuade you to consider a slightly
 ! easier-to-deal-with DBMS.
 - Sending post_syncdb signal for blog: ['Post']

Change History

comment:1 Changed 6 years ago by andrew

  • Status changed from new to closed
  • Resolution set to worksforme
  • Milestone set to 0.6.3

It looks like you have an initial migration that you made _after_ you'd used syncdb on an app; I suggest looking at ConvertingAnApp in future. In the meantime, try:

./manage.py migrate blog --fake 0001
./manage.py migrate
Note: See TracTickets for help on using tickets.