Could I get some opinions on this MySQL table structure please?
Is the amount of varchar
fields bad? Are there better alternatives?
The kind of data should be fairly self-explanatory.
CREATE TABLE `users` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`active` bit(1) NOT NULL DEFAULT b'1',
`email` varchar(64) NOT NULL,
`password` char(128) NOT NULL,
`forename` varchar(32) NOT NULL,
`surname` varchar(32) NOT NULL,
`ip` int(10) unsigned NOT NULL,
`address` varchar(32) NOT NULL,
`address_2` varchar(32) DEFAULT NULL,
`city` varchar(32) NOT NULL,
`county` varchar(32) NOT NULL,
`postcode` varchar(16) NOT NULL,
`country` char(2) NOT NULL,
`country_other` varchar(16) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `email` (`email`),
KEY `password` (`password`)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
Thanks!