Code:
CREATE TABLE IF NOT EXISTS `items` ( `id` int(11) NOT NULL AUTO_INCREMENT, `title` varchar(255) NOT NULL, `description` mediumtext NOT NULL, `user_id` bigint(100) NOT NULL, `to_read` tinyint(1) NOT NULL DEFAULT '0', `added_at` datetime NOT NULL, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, PRIMARY KEY (`id`), KEY `user_id` (`user_id`), ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `tags` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user_id` bigint(100) NOT NULL, `item_id` int(11) NOT NULL, `tag` varchar(255) NOT NULL, `created_at` datetime NOT NULL, PRIMARY KEY (`id`), KEY `item_id` (`item_id`), KEY `user_id` (`user_id`), ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
I want to know if this table design is good in practice or not? Sometimes, I've seen 3 tables be used when people implement tagging functionality.
So please anyone that can confirm this, would be very kind to