R
R
RMate2019-01-26 23:48:37
Database
RMate, 2019-01-26 23:48:37

How to make a custom table constructor?

Hello everyone, the theoretical part of the question torments me and my curiosity ... I stumbled upon this in Bitrix24 CRM, so I will describe it using its example.
We have, for example, a sign "customers". clients have fields "phone", "name", "mail". The service itself runs in the cloud. And for each company there is an opportunity to customize the table, i.e. user 1 can add an "address" field, user 25 can add a "source" field, and so on. Moreover, a data type can be selected for the field.
As a matter of fact, I was interested in how it would be correct to implement this in the database?
The option comes to mind with "saw a table with the fields "owner_id", "field_name", "value". But in this case, there is no way to set the data type, and from the point of view of making selections on this data, there will be a very big trouble in performance.
Another option is to use JSONP for these purposes, this will solve the typing problem, but leave the problem with the lack of indexes, and the complexity of the selection.In general, I think there is a beautiful concise option that I don’t know about :)
Please tell me what would be most correct implementation?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yuri, 2019-01-27
@RMate

in general, as written. google EAV

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question