2011-09-26 68 views
0

有人可以幫我解決這個問題: 我最近安裝了南來使用它來更新生產服務器上基於django的項目中的更改(Appache 2.0,MySql 5.0,python 2.5,Mysqldb for python, Django 1.3和南0.7.3)。 將我的簽名命名到南的應用程序,這是成功完成,命令manage migrate signature它輸出以下後:south&mysql問題

C:\python projects\suivireal>manage.py migrate signature 

Running migrations for signature: 
- Migrating forwards to 0002_auto__del_field_agent_titre_en__add_field_agent_ni 

veau__add_field_agen. 

> signature:0002_auto__del_field_agent_titre_en__add_field_agent_niveau__add_fi 

eld_agen 

Traceback (most recent call last): 
File "C:\python projects\suivireal\manage.py", line 14, in <module> 

    execute_manager(settings) 

File "C:\Python26\Lib\site-packages\django\core\management\__init__.py", line 

438, in execute_manager 

    utility.execute() 

File "C:\Python26\Lib\site-packages\django\core\management\__init__.py", line 

379, in execute 

    self.fetch_command(subcommand).run_from_argv(self.argv) 

File "C:\Python26\Lib\site-packages\django\core\management\base.py", line 191, 

in run_from_argv 

    self.execute(*args, **options.__dict__) 

File "C:\Python26\Lib\site-packages\django\core\management\base.py", line 220, 

in execute 

    output = self.handle(*args, **options) 

File "c:\python26\lib\site-packages\South-0.7-py2.6.egg\south\management\comma 

nds\migrate.py", line 102, in handle 

    delete_ghosts = delete_ghosts, 

File "c:\python26\lib\site-packages\South-0.7-py2.6.egg\south\migration\__init 

__.py", line 202, in migrate_app 

    success = migrator.migrate_many(target, workplan, database) 

File "c:\python26\lib\site-packages\South-0.7-py2.6.egg\south\migration\migrat 

ors.py", line 215, in migrate_many 

    result = migrator.__class__.migrate_many(migrator, target, migrations, datab 

ase) 

File "c:\python26\lib\site-packages\South-0.7-py2.6.egg\south\migration\migrat 

ors.py", line 284, in migrate_many 

    result = self.migrate(migration, database) 

File "c:\python26\lib\site-packages\South-0.7-py2.6.egg\south\migration\migrat 

ors.py", line 121, in migrate 

    result = self.run(migration) 

File "c:\python26\lib\site-packages\South-0.7-py2.6.egg\south\migration\migrat 

ors.py", line 94, in run 

    dry_run.run_migration(migration) 

File "c:\python26\lib\site-packages\South-0.7-py2.6.egg\south\migration\migrat 

ors.py", line 172, in run_migration 

    self._run_migration(migration) 

File "c:\python26\lib\site-packages\South-0.7-py2.6.egg\south\migration\migrat 

ors.py", line 162, in _run_migration 

    raise exceptions.FailedDryRun(migration, sys.exc_info()) 

south.exceptions.FailedDryRun: ! Error found during dry run of '0002_auto__del_ 

field_agent_titre_en__add_field_agent_niveau__add_field_agen'! Aborting. 

Traceback (most recent call last): 

File "c:\python26\lib\site-packages\South-0.7-py2.6.egg\south\migration\migrat 

ors.py", line 159, in _run_migration 

    migration_function() 

File "c:\python26\lib\site-packages\South-0.7-py2.6.egg\south\migration\migrat 

ors.py", line 56, in <lambda> 

    return (lambda: direction(orm)) 

File "C:\python projects\suivireal\..\suivireal\signature\migrations\0002_auto 

__del_field_agent_titre_en__add_field_agent_niveau__add_field_agen.py", line 12, 

in forwards 

    db.delete_column('signature_agent', 'titre_en') 

File "c:\python26\lib\site-packages\South-0.7-py2.6.egg\south\db\mysql.py", li 

ne 90, in delete_column 

    result = cursor.execute(get_fkeyname_query % (db_name, table_name, name)) 

File "C:\Python26\Lib\site-packages\django\db\backends\util.py", line 34, in e 

xecute 

    return self.cursor.execute(sql,  params) 

File "C:\Python26\Lib\site-packages\django\db\backends\mysql\base.py", line 86 

, in execute 

    return self.cursor.execute(query, args) 

File "C:\Python26\Lib\site-packages\MySQLdb\cursors.py", line 176, in execute 

    if not self._defer_warnings: self._warning_check() 

File "C:\Python26\Lib\site-packages\MySQLdb\cursors.py", line 92, in _warning_ 

check  warn(w[-1], self.Warning, 3) 

Warning: Table 'chold.signupsetup' doesn't exist 

我用Google搜索,看它是否與MySQL有關的問題,但我不能找到一個出去的路。

+1

請解釋你在輸入「遷移簽名」之前做了什麼。 – nicolas

+0

以「convert_to_south」開頭,然後我在模型中進行了一些更改,添加了一個字段並更改了字段名稱。之後,當我執行schemamigrate選項時,它讓我填寫這些字段的默認值字段,我做了,它工作正常。在那之後,我根據它的重新命令執行遷移,它對上面解釋的錯誤進行排序。 – Hakim

回答

0

錯誤是說您的數據庫中有一個名爲「chold.signupsetup」的表丟失。

你應該檢查這個表是否存在,如果沒有創建它。創建django應用程序表的常用方法是運行syncdb:

$ python manage.py syncdb 

然後再次嘗試運行遷移。

+0

我確信在開始遷移之前做了syncdb。我按照你的說法做了,同樣的問題出現了。請注意,錯誤報告,它以某種方式從MYsqldb驅動程序生成。我找不到原因? – Hakim