开发者

Two questions for photo tables - FK and profile photo Q

1) I have two tables: Photos table and EXIF table. EXIF table stores the exif data of a photo.

Photo table has: Photo_id, exif_id. EXIF table has: exif_id, photo_id.

So in essence, exif_id in photo table can be FK to exif_id开发者_如何转开发 in EXIF table. But photo_id in exif table can be FK to photo_id in photo table. Do i need two FKs here or can one FK do?

2) All sample schemas I have seen have a photo table for alum photos. What about profile album and the live profile photo? IS that usually a separate table or just a flag in the album table?


your question is a little vague, but based on the given info:

1) you only need exif_id if you can have multiple EXIF rows per Photo_id. If not, just go with Photo_id

2) I'd just use a flag to tell the photo type.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜