Link to home
Start Free TrialLog in
Avatar of Vishesh1990
Vishesh1990

asked on

Creating multiple messages in a social media database.

hi, so far i have created a user table, messages table, friends table and other tables which are not needed for this section of my project.  my messages table currently reads as such. the fields are in order: message_id, owner_id, subject, body, date_time_posted, is_public.

 
1	1	Party at my place	2nite 7 pm till l8!!!! CU there!!!	                2011-02-15 15:06:28     1	
2	1	COMPSCI280	        Just enrolled there, seems a cool course	       2011-02-15 15:20:35	   1
3	1	Hangover!	        Maaaan, that party rocked!	                       2011-02-16 11:45:15	   0

Open in new window


so basically my current table has messages, and can distinguish between whether the message is public or only visible to the users friend. i now want to make a third type of message, which is only visible to selected friends (i.e. not all).

so i think i have to make a change to my messages table so it can now distinguisgh between the 3 types of messages. and also create a new table which will work as message membership table. how would i go about doing these?
ASKER CERTIFIED SOLUTION
Avatar of MyMusicWall
MyMusicWall

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Vishesh1990
Vishesh1990

ASKER

hi thanks for your response. i was thinking the exact same thing, but thought that because my message table already includes owners_id. do we have to also put Sender_id in the new table. because when we link the message_id to receipent_id. we are essentially already linking the owners_id. so no need to repeat this.

the only reason im saying this is because i am trying to make this as small and efficient as possible.

i see what you say about thread_id. because all responses will come under one thread we will not be getting massive repeats. (again saving storage space).

and also simply making the new value '1' or '2' is sufficient enough to distinguish between the 3 types? no more changes needed?
You are correct, you would only need it in the message table..

No you shouldn't need any other changes to the database schema :-)

What are you developing the Social Media site in?  I'm writing one using ASP
thanks for that, im running mine on a phpMyAdmin server run at another location.
thanks for the tips, it got me heading in the right direction. thanks