jointakahe / takahe

An ActivityPub/Fediverse server
BSD 3-Clause "New" or "Revised" License
1.12k stars 86 forks source link

Ensure add_stator_indexes only run for direct descendants of StatorModel #696

Open lullis opened 8 months ago

AstraLuma commented 8 months ago

Does this have a bug associated with it? What's the behavior you're trying to prevent?

lullis commented 8 months ago

The issue is that these indices only make sense on models that derive directly from StatorModel. If you create any other model that itself is already derived from StatorModel (e.g, Identity) then the system will fail the check due to issues with the indices that are not related to the table you are creating.

AstraLuma commented 4 months ago

Ah, ok, yeah, if you have a concrete model inheriting from a concrete model (Multi Table Inheritance), this code will fail because the indexed columns only exist on the parent table.

This largely looks good, but I'm going to double check some things.