1

sudo python manage.py migrate core を使用しようとしたときに、誰かがこのエラーを説明してくれますか? ありがとうございました。

(django-env)pc-03:Ares user$ sudo python manage.py migrate core
Running migrations for core:
 - Migrating forwards to 0001_initial.
 > core:0001_initial
FATAL ERROR - The following SQL query failed: CREATE TABLE `country` (`countryID` varchar(255) NOT NULL PRIMARY KEY, `abbreviation` varchar(15) NOT NULL, `name` varchar(105) NOT NULL, `prefix` varchar(15) NOT NULL, `active` longtext NOT NULL, `created` datetime NULL, `modified` datetime NULL);
The error was: (1050, "Table 'country' 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 `country` CASCADE; []
   = DROP TABLE `company` CASCADE; []
   = DROP TABLE `campaign` CASCADE; []
   = DROP TABLE `redemptionMethod` CASCADE; []
   = DROP TABLE `incentiveCost` CASCADE; []
   = DROP TABLE `incentive` CASCADE; []
   = DROP TABLE `recipient` CASCADE; []
   = DROP TABLE `code` CASCADE; []
   = DROP TABLE `redeemed` 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: core:0001_initial
4

1 に答える 1

4

エラーは自明です:「テーブル'国'はすでに存在します」、これはデータベースにテーブル'国'がすでに作成されていることを意味します。これを回避するには、最初の移行を偽物として実行できます。

sudo python manage.py migrate core --fake
于 2013-01-25T12:49:46.980 に答える