I know its pretty simple, but i want to get the design right, could someone point out what might be wrong (havent a chance to test it yet), what could be improved etc?
I attatched a graphical version of the tables too.Code:SET FOREIGN_KEY_CHECKS=0; -- Drop table Users DROP TABLE IF EXISTS `users`; CREATE TABLE `users` ( user_id smallint(6) UNSIGNED NOT NULL DEFAULT '0' AUTO_INCREMENT, username varchar(20) NOT NULL, password char(32) NOT NULL, email text NOT NULL, active set(0,1) NOT NULL DEFAULT '0,', age tinyint(4) UNSIGNED NOT NULL, forename varchar(50) NOT NULL, surname varchar(50) NOT NULL, PRIMARY KEY(`user_id`), INDEX `users_index`(`user_id`), ) TYPE=InnoDB -- Drop table Images DROP TABLE IF EXISTS `images`; CREATE TABLE `images` ( image_id smallint(6) NOT NULL AUTO_INCREMENT, user_id smallint(6) NOT NULL, filepath text NOT NULL, description text NOT NULL, title text NOT NULL, PRIMARY KEY(`image_id`), INDEX `images_index`(`image_id`) FOREIGN KEY (`user_id`) REFERENCES users(`user_id`) ) TYPE=InnoDB SET FOREIGN_KEY_CHECKS=1;
Thanks











Bookmarks