I was postponing this but shouldn't have worried. Despite the
complexities evident in various web recipes after googling, this is my
simple recipe:
Python 2.7 and 3.4, Django 1.8 and Postgres 9.3 on Windows 8.1 and
Python 2.7, Django 1.8 and Postgres 9.1 on Ubuntu 12.04
1. Run all unit tests
2. Change model name to class Newname(...)
3. Resolve all the obvious issues by running the dev server, identify
where things go wrong and repair them until the project software is
mostly running with the Newname model. You may not get it to run but the
dev server should not identify too many issues. Note, you may get the
odd ProgrammingError - relation "Oldname" does not exist. Don't worry
too much because you haven't renamed the table yet.
4. Create an empty migration using the --empty flag
5. Edit the empty operations list like this ...
operations = [
migrations.RenameModel('Oldname', 'Newname')
migrations.AlterModelTable('Newname', 'appname_newname'),
]
6. migrate
Note, you will probably need to or perhaps should delete stale content
types at the end of the migration.
7. Run all unit tests
Thank you Sir Andrew and Django
Hope this helps someone
Mike
--
You received this message because you are subscribed to the Google Groups "Django
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/56C19073.5090505%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.