南& mysql问题

发布于 2024-12-06 09:24:53 字数 4074 浏览 0 评论 0原文

有人可以帮我解决这个问题吗: 我最近安装了 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

音栖息无 2024-12-13 09:24:53

该错误表明您的数据库中缺少一个名为“chold.signupsetup”的表。

您应该检查该表是否存在,如果不存在则创建它。为 django 应用程序创建表的常用方法是运行syncdb:

$ python manage.py 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:

$ python manage.py syncdb

Then try running the migration again.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文