Maintaining integrity of pk content in Django deployment
When you run syncdb in Django, the primary keys of the content types will be recalculated. If I create new models, the next time I run syncdb, the primary keys of the content types will be different.
If I have an application running in production, how can I update the database with new models and keep the integrity of the pks content type?
a source to share
Running syncdb
does not update the existing ContentType values — they are stored in the database and are not changed. Therefore, the relationships that depend on them will not be affected.
New models, however, will receive new ContentType values when syncdb runs, and there is currently no way to predict what this will be. As Ludwik points out, this issue is addressed in 1.2.
a source to share