django 1.7 migrations — how do I clear all migrations and start over from scratch?

So the step-by-step plan I outlined in my question does work, but instead of deleting rows from the south_migrationhistory database table, I had to delete rows from the django_migrations database table. The command is: DELETE FROM django_migrations WHERE app=’my_app’ Once this is done, you will be able to re-run your migrations from scratch.

What is the best approach to change primary keys in an existing Django app?

Agreed, your model is probably wrong. The formal primary key should always be a surrogate key. Never anything else. [Strong words. Been database designer since the 1980’s. Important lessoned learned is this: everything is changeable, even when the users swear on their mothers’ graves that the value cannot be changed is is truly a natural … Read more

django no such table:

Updated answer for Django migrations without south plugin: Like T.T suggested in his answer, my previous answer was for south migration plugin, when Django hasn’t any schema migration features. Now (works in Django 1.9+): T.T wrote: You can try this! python manage.py makemigrations python manage.py migrate –run-syncdb Outdated for south migrations plugin As I can … Read more

migrating django-model field-name change without losing data

Changing the field name while keeping the DB field Adding an answer for Django 1.8+ (with Django-native migrations, rather than South). Make a migration that first adds a db_column property, and then renames the field. Django understands that the first is a no-op (because it changes the db_column to stay the same), and that the … Read more