Google Contacts Address Book Scheme - How to get from 1 to many data fields?

In Google Contacts, it seems that it allows you to get as many email addresses, phone numbers, addresses, etc. as possible. You can simply click the "Add" link to make as many fields as you want.

Does it make me know how this is done in the circuit?

+3
source share
1 answer

There is a table called custom_fields(profileid, moduleid, fieldid, fieldlabel) where you define fields, for example: phone, dob, dogs, descendants, and then in another table custom_fields_values(contactid, fieldid, value) you set values ​​for each client / user field .

custom_fields
-------------
user1, contacts, 1000, Dogs
user1, contacts, 1001, Children
user2, contacts, 1002, Car Color

custom_fields_values
-------------
120,1000,4
120,1001,0
121,1000,0
121,1001,0
122,1002, Red
123,1002, Transparent :)
124,1002, Green
+2
source

Source: https://habr.com/ru/post/1730748/


All Articles