Ticket #351 (closed defect: duplicate)
south.db.sqlite3.DatabaseOperations._fields not updated after an add_column
| Reported by: | olivier.mansion@… | Owned by: | andrew |
|---|---|---|---|
| Priority: | major | Milestone: | 0.7 |
| Component: | databaseapi | Version: | 0.6.2 |
| Keywords: | Cc: |
Description
When many migrations are performed by the migrate command, in some cases, column added with add_column can disappear.
Here is an example of migration :
First migration:
A delete_column on table T (it loads DatabaseOperations?._fields)
Second migration :
An add_column on table T (at the very end, DatabaseOperations?._fields is not updated with this new column as _populate_current_structure not called)
Third migration :
An delete_column on table T (at the very end, table is rebuilt with _fields data => field added in second migration disappears)
I've linked a project that reproduce the issue:
- trash the database,
- syncdb,
- migrate,
=> OperationalError?: table app_test has no column named name3
