Combine Friend/Ignore lists
Posted: Tue Dec 29, 2009 6:40 pm
LE/Scat,
I'd like to propose making a single table for friends/ignore (character_social?) that holds both friends and ignore lists. Current tables look like this:
Combine the two into a single table, named accordingly. Engine InnoDB. Add a column called "flag" or "option" or something, where 0 = friend, 1 = ignore.
New table (just a suggestion)
I am ok with leaving a varchar(64) for name, because this prevents anyone from deleting and re-creating an annoying character who can then start chatting at the ignorer again
(you know how I prefer int's to varchar's) but yeah, i can see name being the best approach here.
If you do not see any issues with doing this, please go for it. Just trying to minimize the tables we're creating. We're out of control!
though imo, there can never be too many tables 
I'd like to propose making a single table for friends/ignore (character_social?) that holds both friends and ignore lists. Current tables look like this:
Code: Select all
CREATE TABLE `character_friendlist` (
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`char_id` INT(10) UNSIGNED NOT NULL DEFAULT '0',
`name` VARCHAR(64) NOT NULL DEFAULT '',
PRIMARY KEY (`id`),
UNIQUE KEY `CharIDNameIdx` (`char_id`,`name`)
) ENGINE=MYISAMCode: Select all
CREATE TABLE `character_ignorelist` (
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`char_id` INT(10) UNSIGNED NOT NULL DEFAULT '0',
`name` VARCHAR(64) NOT NULL DEFAULT '',
PRIMARY KEY (`id`),
UNIQUE KEY `CharNameIdx` (`char_id`,`name`)
) ENGINE=INNODBNew table (just a suggestion)
Code: Select all
CREATE TABLE `character_social` (
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`char_id` INT(10) UNSIGNED NOT NULL DEFAULT '0',
`name` VARCHAR(64) NOT NULL DEFAULT '',
`type` TINYINT(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
UNIQUE KEY `CharNameIdx` (`char_id`,`name`)
) ENGINE=INNODBIf you do not see any issues with doing this, please go for it. Just trying to minimize the tables we're creating. We're out of control!