简体   繁体   中英

django-south Error during migrate

I am getting the below error when I am trying to use south to migrate in django.

Running migrations for sites:
    - Migrating forwards to 0004_initial.
     > sites:0002_initial
    FATAL ERROR - The following SQL query failed: CREATE TABLE `django_site` (`id`
    nteger AUTO_INCREMENT NOT NULL PRIMARY KEY, `domain` varchar(100) NOT NULL, `na
    e` varchar(50) NOT NULL)
    The error was: (1050, "Table 'django_site' 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 `django_site` CASCADE; []

 ! The South developers regret this has happened, and would
 ! like to gently persuade you to consider a slightly
 ! easier-to-deal-with DBMS (one that supports DDL transactions)
 ! NOTE: The error which caused the migration to fail is further up.
Error in migration: sites:0002_initial
Traceback (most recent call last):
  File "manage.py", line 10, in <module>
  .............

  django.db.utils.OperationalError: (1050, "Table 'django_site' already exists")

The similar issue is also open here .Any solution to this ? The error seems due to Create table statement as discussed in the github issue or there might be other errors.I can't figure it out.

if django version < 1.7

python manage.py migrate yourapp --fake

else

python manage.py migrate --fake

--fake: Records the migration sequence as having been applied, but doesn't actually run it. -> more

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM