南& mysql问题
有人可以帮我解决这个问题吗: 我最近安装了 South,以使用它更新生产服务器上基于 django 的项目中的更改(Appache 2.0、MySql 5.0、python 2.5、Mysqldb for python、django 1.3 和 South 0.7.3)。 将我的名为签名的应用程序转换为 South 并成功完成后,命令管理迁移签名
它会打印以下输出:
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
我在谷歌上搜索了该问题是否与 mysql 有关,但我无法找到出路。
can somebody help me out on this:
I have installed recently south to use it updating changes in my django-based project on the production server (Appache 2.0, MySql 5.0, python 2.5, Mysqldb for python, django 1.3, and south 0.7.3).
After converting my app named signature to south, which was done successfully, the commandmanage migrate signature
it prints the following output:
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
I googled to see the problem whether it is related to mysql but I couldn't a find a way out.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
该错误表明您的数据库中缺少一个名为“chold.signupsetup”的表。
您应该检查该表是否存在,如果不存在则创建它。为 django 应用程序创建表的常用方法是运行syncdb:
然后尝试再次运行迁移。
The error is saying that there is a missing table in your database called "chold.signupsetup".
You should check that that this table exists, and if not create it. The usual way of creating tables for django apps is to run syncdb:
Then try running the migration again.