I am creating a database where one of the 'user' tables needs to have an array of foreign keys linking to multiple rows of another table. I'm trying to figure out the best way to handle this.
user | projects |
---|---|
jeff | [1,2,6] |
dave | [3,4] |
projects | otherstuff |
---|---|
1 | 'content 1' |
2 | 'content 2' |
3 | 'content 3' |
4 | 'content 4' |
5 | 'content 5' |
6 | 'content 6' |
I guess could make a table for every user called 'user_projects' but if I have 10k users, it seems frustrating to have 10k tables with redundant rows if each some users work on the same project.
Thoughts?
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.