Forum Moderators: open
What should be the best table structure implementation for this matter?
This is my user table:
CREATE TABLE `user` (
`id_user` int(11) NOT NULL auto_increment,
`email` varchar(50) NOT NULL default '',
`name` varchar(25) NOT NULL default '',
`lastname` varchar(25) NOT NULL default '',
`birthdate` int(14) default NULL,
`id_country` int(11) default NULL,
PRIMARY KEY (`id_user`)
);
And this is my temporal block table (temporal because i still dont know if this is the best way to do it):
CREATE TABLE `block` (
`id_block` int(11) NOT NULL auto_increment,
`id_user` int(11) default NULL,
`id_user_blocked` int(11) default NULL,
`date` int(14) default '0',
PRIMARY KEY (`id_block`)
);
Points to consider:
* If A blocks B, B shouldnt be able to find or message user A in the future.
* If A blocks B, A also shouldnt be able to find or message user A in the future (unless he unblocks him from another interface).
Is there any way to optimize this? Thanks!