3 ms·
Or just use JSONField, because that’s exactly the reason why it exists.
by alexandernst 8y ago
Or just use JSONField, because that’s exactly the reason why it exists.
- ivan_ah 8y agoYep, it's essentially the same thing. I guess EAV approach was the old way from before JSONField days. In both cases the cost of this flexibility and migration-less data model extensibility is extra code paths and guards to check if these "optional" attributes are present or not. Spaghetti code anyone?
- Zodd 8y agoJSONField is not always available and is not equivalent to EAV.
- dplgk 8y agoIn what situation is JSONField not available but other third-party modules are?
- Zodd 8y agoJSONField is specific to PostgreSQL [1]. If you're working in Django and are bound to some other vendor, RDMS-agnostic solution is handy. [1] https://docs.djangoproject.com/en/2.0/ref/contrib/postgres/fields/# https://docs.djangoproject.com/en/2.0/ref/contrib/postgres/f...