+ self.start_transaction()
+
+ # Rename primary key index, will not rename other indices on
+ # the table that are used by django (e.g. foreign keys). Until
+ # figure out how, you need to do this yourself.
+ try:
+ generic.DatabaseOperations.rename_table(self, old_table_name+"_pkey", table_name+ "_pkey")
+ except:
+ if self.debug:
+ print " ~ No such primary key (ignoring error)"
+ self.rollback_transaction()
+ else:
+ self.commit_transaction()
+ self.start_transaction()
+
+
+ def rename_index(self, old_index_name, index_name):
+ "Rename an index individually"
+ generic.DatabaseOperations.rename_table(self, old_index_name, index_name)