diff options
Diffstat (limited to 'modules/tag/helpers')
-rw-r--r-- | modules/tag/helpers/tag_installer.php | 35 |
1 files changed, 16 insertions, 19 deletions
diff --git a/modules/tag/helpers/tag_installer.php b/modules/tag/helpers/tag_installer.php index 07544c54..3c16e3f3 100644 --- a/modules/tag/helpers/tag_installer.php +++ b/modules/tag/helpers/tag_installer.php @@ -20,26 +20,23 @@ class tag_installer { static function install() { $db = Database::instance(); - $version = module::get_version("tag"); - if ($version == 0) { - $db->query("CREATE TABLE IF NOT EXISTS {tags} ( - `id` int(9) NOT NULL auto_increment, - `name` varchar(64) NOT NULL, - `count` int(10) unsigned NOT NULL DEFAULT 0, - PRIMARY KEY (`id`), - UNIQUE KEY(`name`)) - ENGINE=InnoDB DEFAULT CHARSET=utf8;"); + $db->query("CREATE TABLE IF NOT EXISTS {tags} ( + `id` int(9) NOT NULL auto_increment, + `name` varchar(64) NOT NULL, + `count` int(10) unsigned NOT NULL DEFAULT 0, + PRIMARY KEY (`id`), + UNIQUE KEY(`name`)) + ENGINE=InnoDB DEFAULT CHARSET=utf8;"); - $db->query("CREATE TABLE IF NOT EXISTS {items_tags} ( - `id` int(9) NOT NULL auto_increment, - `item_id` int(9) NOT NULL, - `tag_id` int(9) NOT NULL, - PRIMARY KEY (`id`), - KEY(`tag_id`, `id`), - KEY(`item_id`, `id`)) - ENGINE=InnoDB DEFAULT CHARSET=utf8;"); - module::set_version("tag", 1); - } + $db->query("CREATE TABLE IF NOT EXISTS {items_tags} ( + `id` int(9) NOT NULL auto_increment, + `item_id` int(9) NOT NULL, + `tag_id` int(9) NOT NULL, + PRIMARY KEY (`id`), + KEY(`tag_id`, `id`), + KEY(`item_id`, `id`)) + ENGINE=InnoDB DEFAULT CHARSET=utf8;"); + module::set_version("tag", 1); } static function uninstall() { |