Changes between Version 8 and Version 9 of Ticket #35941


Ignore:
Timestamp:
Dec 2, 2024, 2:11:00 AM (5 weeks ago)
Author:
Csirmaz Bendegúz
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #35941 – Description

    v8 v9  
    4141It's possible to implement other strategies to deal with composite generic foreign keys.
    4242
    43 1. JSONField - instead of `CharField` / `TextField`, we could make "object_id" a `JSONField`
    44 2. GenericForeignKey with multiple object_ids - this is less flexible, can't store regular primary keys
     431. JSONField - instead of `CharField` / `TextField`, we could make "object_id" a `JSONField`. This achieves the same thing as my proposal but save the `::jsonb` cast.
     442. GenericForeignKey with multiple object_ids - less flexible, can't store both regular primary keys and composite primary keys.
    4545
    46 There's no reason we couldn't implement other strategies, I believe the JSON approach provides the most flexibility (at the cost of performance).
     46There's no reason we couldn't implement other strategies. I believe my proposal provides the most flexibility and backwards-compatibility (at the cost of performance).
    4747
    4848Any feedback is appreciated!
Back to Top