Re:Surviving Django, if you care about databases
by dvarrazzo on Friday August 07, 2020 @07:23AM
(#24080704)
> You can put comments in Python files...
only if the comment pertains to a django feature, not to a schema feature that cannot be expressed in django (e.g. a partial index designed for a specific query).
> You can name your migrations with:
In the example there is a foreign key name, not a migration name. It is persisted in the database, it's not ephemeral like a migration name, for which choosing a meaningful name has only a temporary value.
Just two factual corrections; for the rest our experiences diverge, that's fine.
Re:Surviving Django, if you care about databases
by kissgyorgy on Friday August 07, 2020 @04:09PM
(#24085959)
> for the rest our experiences diverge, that's fine.
You can put comments in Python files...
> With constraints named meaningfully, available for manipulation, not auth_group_permissions_group_id_b120cbf9_fk_auth_group_id.
You can name your migrations with:
> In my opinion, if there is something less likely to happen than writing a complex app to run on interchangeable databases, it's the need to repeat the same history of migrations.Maybe he never worked in a team? Or wrote any integration tests at all? Or implemented rollback? Because those are pretty much basic things for every serious project.
> I have a patch_db.py script that I have used, with small variations, in several projects.
So you are basically wrote your own schema migrations tool, but inconsistent across projects, and you maintain it yourself. Not a good idea IMO.