Hi people. I've to do a migration for the database, specifically I've to rename a table.
To do so I've a RunPython that runs this sql statemnet `ALTER TABLE "old_table" RENAME TO "new_table"` First question: should I use https://docs.djangoproject.com/en/1.8/ref/migration-operations/#renamemodel , does it do the same? Will these operation update all the refrences in the code, such that django will keep working without problems? Now, I'm using postgres and I've two servers using the same DB, let's call them A and B. when I'll rename the table the code will break, so the procedure will be: - stop A - update A - migrate - stop B - start A The problem is, that I've to be sure that migrations are atomic and have a transaction that locks the DB (or that table). Reading the documentation I found: *On databases that do support DDL transactions (SQLite and PostgreSQL), RunPython operations do not have any transactions automatically added besides the transactions created for each migration.* - https://docs.djangoproject.com/en/1.10/ref/migration-operations/ (I'm using 1.8) If i go with renameModel, will it be in a single transaction? What I want to avoid is to stop both A and B to perform migrations. It would be better to do the migration and then stop B, this should have a down that is smaller compared to stopping all services and the run them again. any suggestion? Ciao -- 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 [email protected]. To post to this group, send email to [email protected]. 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/3205d24d-537b-4819-b2e4-e1adc31a3d46%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.

