[Solved]-Adding Autoincrement field to existing model with Django South?


I solved the problem that required me to do this with a workaround:

I copied the data from the original table into a temporary table in SQL with INSERT INTO... SELECT.... I then deleted the original table and recreated it with the autoincrement field. Then I copied the data back into the new table, with the autoincrement values added automatically by the INSERT command. Finally I executed a fake run of the South migration to make South’s tables consistent with the new schema.

Leave a comment