I am attempting to create a DB for my app and one thing I'd like to find the best way of doing is creating a one-to-many relationship between my Users
and Items
tables.
I know I can make a third table, ReviewedItems
, and have the columns be a User
id and an Item
id, but I'd like to know if it's possible to make a column in Users
, let's say reviewedItems
, which is an integer array containing foreign keys to Items
that the User
has reviewed.
If PostgreSQL can do this, please let me know! If not, I'll just go down my third table route.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…