一个配置文件可以有多种配置文件类型。该配置文件可以有许多字段,这些字段都与查找表相关联。某些字段可以有多种选择。
\n\nprofile -> profile_date -> one relationship status, one zodiac, many languages, many countries traveled, many cuisines, many activities, ...\n\nprofile -> profile_network -> one company, one school, ...\n\nprofile -> ...\n
Run Code Online (Sandbox Code Playgroud)\n\n字段的查找表如下所示:
\n\nid type\n1 \xe2\x99\x88 ARIES\n2 \xe2\x99\x89 TAURUS\n3 \xe2\x99\x8a GEMINI\n4 \xe2\x99\x8b CANCER\n5 \xe2\x99\x8c LEO\n6 \xe2\x99\x8d VIRGO\n7 \xe2\x99\x8e LIBRA\n8 \xe2\x99\x8f SCORPIO\n9 \xe2\x99\x90 SAGITTARIUS\n10 \xe2\x99\x91 CAPRICORN\n11 \xe2\x99\x92 AQUARIUS\n12 \xe2\x99\x93 PISCES\n
Run Code Online (Sandbox Code Playgroud)\n\n如果该字段是单个选择,我们将加入查找表,然后就完成了。
\n\n-> profile_date (zodiac_type_id) -> zodiac_type.id\n
Run Code Online (Sandbox Code Playgroud)\n\n如果字段是多项选择,则中间有一个用于多对多的联接表。
\n\n-> profile_date -> (profile_date_id) profile_date_languages (language_type_id) -> language_type.id\n
Run Code Online (Sandbox Code Playgroud)\n\n …