database - Complex combinatoric database tree - many to many with variation pivot
问题描述
I'll keep it short and brief. I've got two models: Scheme
and Feature
with a many to many relationship between them. What I want to achieve but don't know how is the following: I need a given value to be present in a database according to the features a scheme has. That means, for every possible combination of a scheme and all of the possible features, I want to have a particular value (in this case - an image to display for the scheme according to its features).
Example:
Scheme 1 has feature 1 - image 1;
Scheme 1 has feature 2 - image 2;
Scheme 1 has feature 1 and 2 - image 3
Scheme 1 has feature 1 and 3 - image 4 and so on.
What is the optimal db structure for that purpose? Thanks in advance!
解决方案
推荐阅读
- camera - 用户无法上传文件大小超过 4MB 的图像
- json - 反应原生如何迭代json数据并在组件中呈现
- c# - 使用 Linq 而不是嵌套的 foreach 循环来求和值
- javascript - 将联系表 7 值传递给 Wordpress 中的另一个表单
- docker - 如何将内容从一个 pod 推送到另一个 pod?
- python - 乌龟不在坐标时拿起笔
- java - 如何使用 NetBeans 在 java 中处理通过 New JFrame 创建的框架?
- amazon-redshift - Redshift COPY - 获取文件中被拒绝的行
- firebase - 了解 NoSQL CRUD 调用
- c - 编译ac程序时如何解决clang中的链接器问题?