【问题标题】:Failed schema migration with Django South: what should I do?Django South 模式迁移失败:我该怎么办?
【发布时间】:2012-05-09 09:44:51
【问题描述】:

我将 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 django-south


    【解决方案1】:

    如果这些表中有您要保存的数据,请不要删除它们。

    很难在没有看到实际错误的情况下提供任何更具体的帮助,这应该遵循您引用的消息。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-11-21
      • 2014-03-10
      • 2010-09-14
      • 2013-02-13
      • 1970-01-01
      • 2021-10-15
      • 1970-01-01
      相关资源
      最近更新 更多