Building a database for storing user uploaded images

TechBoyJK

Lifer
Oct 17, 2002
16,701
60
91
I need to build a simple db for storing user uploaded images. Functions needed are pretty straigh forward.

Users will be able to create logical folders, and upload photos to any chosen folder. I've already got the uploading process working, I'm just trying to work out the best way to store the photo info.. Here's my schema so far. Thoughts? I think I have it normalized very well and this layout seems logical. I tried to explain the purpose of columns behind the #


tbl_member_photo_folders

photo_folder_id (int/null/pk) #unique id of each declared folder
member_id (int/fk) #member id of owner
thumbnail_url (varchar 255) #direct url to thumbnail image for folder
created (datetime)
created_ip (varchar 15)
last_modified (datetime)
last_modified_ip (varchar 15)
folder_position (smallint) #order in which folders are displayed
photo_security (smallint) #user defined viewability


tbl_member_photos

photo_id (int/null) primary key #unique id of each photo
member_id (int) foreign key #member id of owner
folder_id (int) foreign key #id of parent folder
public_url (varchar 255) #public url for photo
private_url (varchar 255) #private url for photo (local resource)
photo_file (varchar 255) #photo filename public_url/photo_file creates full path
created (datetime)
created_ip (varchar 15)
last_modified (
last_modified_ip (varchar 15)
photo_position (smallint) #order in which photos are displayed
photo_security (smallint) #user defined viewability



tbl_member_photo_captions

caption_id (int/null) primary key #unique id of caption
profile_photo_id (int) foreign key #id of parent photo
caption (varchar max) #caption content
 

WannaFly

Platinum Member
Jan 14, 2003
2,811
1
0
I'm not sure what you are looking for - but I have a few suggestions:
1) If you do not need more then one caption per photo, just add the caption to tbl_member_photos.
2) 255 may be too short for url/file paths.
3) Unless you really have a need for a 1M char caption, avoid varchar(max) - set a limit. Helps with indexing/querying if you ever need up.
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |