mpen
mpen

Reputation: 283263

Gallery database design question regarding users in photos

I'm making a gallery, somewhat similar to Facebook's. I want users to be able to tag other users in photos, including non-registered users. Is it best to have a table in_photo with columns (user_id, name, photo_id) where user_id is null if the user is unregistered, and name is set, and vice-versa, or should I scrap the name column and create a temporary user or some other scheme?

Upvotes: 1

Views: 230

Answers (1)

russau
russau

Reputation: 9108

If there is any another metadata you'd store with the unregistered user - yes, create the temporary users or another table.

If all you store is name - I'd say the way you have it is fine. Although 'name' isn't very descriptive. Maybe 'unregistereduser_name' would be a better name for the column.

Upvotes: 2

Related Questions