I produced a Django application which had its very own internal voting system along with a model known as Election to trace it. I wish to refactor the voting system into its very own application in order to reuse it. However, the initial application is within production and I have to produce a data migration which will take all of the Votes and transplant them in to the separate application.

How do i get two applications to sign up inside a migration to ensure that I get access to both their models? Regrettably, the initial and separate applications have one named Election now, and so i need to understand any conflicts.

Perhaps you have attempted db.rename_table?

I'd begin by developing a migration either in the brand new or old application that appears something similar to this.

class Migration:

    def forwards(self, orm):
        db.rename_table('old_vote', 'new_vote')    

    def backwards(self, orm):
        db.rename_table('new_vote', 'old_vote')

If that doesn't work you are able to migrate the items inside a loop with something along wrinkles:

def forwards(self, orm):
    for old in orm['old.vote'].objects.all():
        # create a new.Vote with old's data
models = {
    'old.vote' = { ... },
    'new.vote' = { ... },

Note: You have to use orm[...] to gain access to any models outdoors the application presently being migrated. Otherwise, standard orm.Vote.objects.all() notation works.