Миграция на юг работала довольно хорошо до сих пор, когда я думаю, что это смешалось.
Я всегда так делаю:
manage.py schemamigration core --auto
manage.py migrate core
В прошлый раз, когда я изменил свою модель, она успешно выполнила миграцию схемы, но потерпела неудачу на втором шаге.Я снова выполнил миграцию ядра (не знаю почему), но он выдал ту же ошибку.Я тогда, хотя хорошо, я изменю что-то еще и сделаю schemamigration снова, чтобы вернуть это на ходу, но это не помогло, и я теперь застрял:
D:\~Sasha\Portman>manage.py migrate --list
core
(*) 0001_initial
(*) 0002_auto__del_field_project_is_active
(*) 0003_auto__add_field_groups_description
(*) 0004_auto__chg_field_project_name
(*) 0005_auto__add_status__del_field_project_phase_indicator_resources__del_fie
(*) 0006_auto__add_project_phase_history
(*) 0007_auto__add_field_project_phase_project__del_field_project_project_phase
(*) 0008_auto__chg_field_project_phase_date_end_plan
(*) 0009_auto__del_field_project_phase_date_start_actual__del_field_project_pha
(*) 0010_auto__del_status
(*) 0011_auto__chg_field_project_phase_history_date_start_plan
(*) 0012_auto__chg_field_project_link_business_idea__chg_field_project_link_cha
(*) 0013_auto__del_field_project_project_sc_reviews
(*) 0014_auto
(*) 0015_auto__add_sc__del_field_sc_event_is_reviewed__del_field_sc_event_date_
(*) 0016_auto__add_field_project_phase_is_finished
(*) 0017_auto__del_field_project_phase_history_date_start_actual__del_field_pro
(*) 0018_auto__del_field_project_phase_date_end_plan__del_field_project_phase_d
(*) 0019_auto__add_field_project_phase_is_reviewed_by_pmo
(*) 0020_auto__add_project_excel_import__add_priorities__add_field_project_is_i
(*) 0021_auto__del_project_excel_import__add_project_imported_from_excel
(*) 0022_auto__add_field_project_imported_from_excel_phase_date_end
(*) 0023_auto__chg_field_project_imported_from_excel_date_end__chg_field_projec
(*) 0024_auto__del_sc__add_sc_review_decision__add_sc_review_task__add_pmo_revi
( ) 0025_auto__chg_field_project_phase_phase_review_goal__chg_field_sc_review_t
( ) 0026_auto__del_field_project_phase_phase_review_goal__add_field_project_pha
... и пытаюсьмигрировать 0025 запускает ту же ошибку:
D:\~Sasha\Portman>manage.py migrate core 0025
- Soft matched migration 0025 to 0025_auto__chg_field_project_phase_phase_review_goal__chg_field_sc_review_t.
Running migrations for core:
- Migrating forwards to 0025_auto__chg_field_project_phase_phase_review_goal__chg_field_sc_review_t.
> core:0025_auto__chg_field_project_phase_phase_review_goal__chg_field_sc_review_t
Traceback (most recent call last):
File "D:\~Sasha\Portman\manage.py", line 11, in <module>
execute_manager(settings)
File "D:\install\python27\lib\site-packages\django\core\management\__init__.py", line 438, in execute_manager
utility.execute()
File "D:\install\python27\lib\site-packages\django\core\management\__init__.py", line 379, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "D:\install\python27\lib\site-packages\django\core\management\base.py", line 191, in run_from_argv
self.execute(*args, **options.__dict__)
File "D:\install\python27\lib\site-packages\django\core\management\base.py", line 220, in execute
output = self.handle(*args, **options)
File "D:\install\python27\lib\site-packages\south\management\commands\migrate.py", line 102, in handle
delete_ghosts = delete_ghosts,
File "D:\install\python27\lib\site-packages\south\migration\__init__.py", line 202, in migrate_app
success = migrator.migrate_many(target, workplan, database)
File "D:\install\python27\lib\site-packages\south\migration\migrators.py", line 215, in migrate_many
result = migrator.__class__.migrate_many(migrator, target, migrations, database)
File "D:\install\python27\lib\site-packages\south\migration\migrators.py", line 284, in migrate_many
result = self.migrate(migration, database)
File "D:\install\python27\lib\site-packages\south\migration\migrators.py", line 121, in migrate
result = self.run(migration)
File "D:\install\python27\lib\site-packages\south\migration\migrators.py", line 95, in run
return self.run_migration(migration)
File "D:\install\python27\lib\site-packages\south\migration\migrators.py", line 77, in run_migration
migration_function()
File "D:\install\python27\lib\site-packages\south\migration\migrators.py", line 56, in <lambda>
return (lambda: direction(orm))
File "D:\~Sasha\Portman\core\migrations\0025_auto__chg_field_project_phase_phase_review_goal__chg_field_sc_review_t.py", line 12, in forwards
db.rename_column('core_project_phase', 'phase_review_goal', 'phase_review_goal_id')
File "D:\install\python27\lib\site-packages\south\db\sqlite3.py", line 128, in rename_column
self._remake_table(table_name, renames={old: new})
File "D:\install\python27\lib\site-packages\south\db\sqlite3.py", line 73, in _remake_table
", ".join(["%s %s" % (self.quote_name(cname), ctype) for cname, ctype in definitions.items()]),
File "D:\install\python27\lib\site-packages\south\db\generic.py", line 134, in execute
cursor.execute(sql, params)
File "D:\install\python27\lib\site-packages\django\db\backends\util.py", line 34, in execute
return self.cursor.execute(sql, params)
File "D:\install\python27\lib\site-packages\django\db\backends\sqlite3\base.py", line 234, in execute
return Database.Cursor.execute(self, query, params)
django.db.utils.DatabaseError: table "_south_new_core_project_phase" already exists
Есть ли способ исправить это сейчас?(