Info about images (width/height) are irrelevant. If i need that i’ll put it in another table but i don’t need images info. What do you think about this db design? What do you think about MyISAM vs InnoDB for specific tables?
Thank you, I appreciate any feedback.
DROP TABLE IF EXISTS `directory`;
CREATE TABLE `directory` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`parent_id` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
DROP TABLE IF EXISTS `file`;
CREATE TABLE `file` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`fk_directory_id` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
DROP TABLE IF EXISTS `tag`;
CREATE TABLE `tag` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
DROP TABLE IF EXISTS `tags_files`;
CREATE TABLE `tags_files` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`fk_file_id` int(11) DEFAULT NULL,
`fk_tag_id` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
Since only “ajreal” answered this question i decided that base for my db design will be db design i suggested. Thanks ajreal for the answer(voteup:)). I know, ajreal, about storing all additional info(users, rights, acl, image sizes, … and all the rest “small infos” that should be stored:) i just wanted to hear another opinions). Thanks.