News for hackers. Stuff that matters.
Re:Django EAV 2 – Entity-Attribute-Value Storage for Django by antsar on Saturday July 28, 2018 @12:00AM (#17631437)
I’ve used the EAV pattern to allow users to add “custom fields” to an object.

The application has Person objects, who work for a Department. Lets say one department wants to record their employees’ shirt size, while another department wants to record their employees’ favorite color. Then, next week, they decide to also track their favorite brand of beer.

EAV allows department administrators to set this up on-the-fly without any development or database migrations.

Another way to tackle the same problem (used by Drupal, for example) is to actually modify the database schema at runtime, creating/modifying tables whenever your users want to change how the application behaves.

There are no comments on this comment yet.