Hacker News new | ask | show | jobs
by qeternity 1652 days ago
> migrations engine is pretty poor

I find this to be an odd take. The Django migrations engine is probably its strongest feature.

2 comments

Any change you make has to be atomic, or it is unable to detect the change, and you have to rely on manual migrations.
What do you mean by this? Auto migrations detect changes in your models. I'm not sure what atomic means in this context.
Let's say you change some attribute and the name of a model, Django simply does not recognize it, nuking the whole attribute
There is at least one way that migrating a + b is different than migrate a + migrate b, in ways that you can then only incrementally migrate your project rather than building from scratch.

It’s mainly in post migrate actions, and specifically for me adding a group for permissions.

If you write manual migrations, then it's often worth it to write the reverse function (in your case, deleting that group) so that you avoid this situation.
It’s not the back and forth, it’s that a migration in b that requires the post migrate step from a will fail if both migrations are run in one shot, (say, because you’re bootstrapping a new dev or test db) but it will work when done incrementally (such as during development or deployment).