#Would it be sane to "splice" a new migration into the middle of the migrations sequence?

2 messages · Page 1 of 1 (latest)

pseudo tiger
#

This is a bit hard to describe ... I maintain a system that has a pile of existing migrations. But it also has a few things in production that were added by hand (a view, and a user). Everything is working fine, but I'd like to somehow "capture" that view and user in a migration, so that if I were to bring up a new instance from scratch, the new instance would (apart from the data) match prod.

I can easily enough add a migration that creates the view and the user. But if I were to reverse that migration -- which is unlikely but conceivable -- it would delete the view and the user, which I don't want.

I suppose I should just not add reverse_sql to the migration, so that it's not reversible. But that seems icky.

So what I think I really want is: a way to wedge this new migration into the sequence, at a very early point (probably right after the initial=True migrations), in order to accurately represent what happened when on prod.

Is this doable, and worth doing?

livid pond