gpt4 book ai didi

mysql - 使用 Django South : what should I do? 的架构迁移失败

转载 作者:行者123 更新时间:2023-11-30 23:31:31 25 4
gpt4 key购买 nike

我将 Django 与 MySQL 结合使用。我安装了 South 并试图将我的应用程序从一种模式迁移到另一种模式。但是,当我运行 $ python manage.py migrate catalog 时,出现以下错误:

 - Migrating forwards to 0003_initial.
> catalog:0003_initial
! 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 `categories` CASCADE; []
= DROP TABLE `product_shapes` CASCADE; []
= DROP TABLE `materials` CASCADE; []
= DROP TABLE `style` CASCADE; []
= DROP TABLE `products` CASCADE; []
= DROP TABLE `products_shape` CASCADE; []
= DROP TABLE `products_materials` CASCADE; []
= DROP TABLE `products_style` CASCADE; []
= DROP TABLE `products_categories` CASCADE; []

! The South developers regret this has happened, and would
! like to gently persuade you to consider a slightly
! easier-to-deal-with DBMS.

有什么方法可以在不删除这些表的情况下进行迁移。我有一种感觉,如果我删除表格,我最终会丢失我试图保存的数据。

编辑:

我认为这是主要错误:

_mysql_exceptions.OperationalError: (1050, "Table 'categories' already exists")

最佳答案

如果其中包含您要保存的数据,请不要删除这些表。

如果没有看到实际错误,很难提供任何更具体的帮助,实际错误应该跟在您引用的消息之后。

关于mysql - 使用 Django South : what should I do? 的架构迁移失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10371036/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com