summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2010-06-18 06:51:02 -0700
committerTim Almdal <tnalmdal@shaw.ca>2010-06-18 06:51:02 -0700
commit84c8d1c79a07aa72bb0a22cd3c0673df6f5886f2 (patch)
treed85cc423c706eabe7d7293a8c97ccb41426073a4
parentfce95785beabb499381d722160d000df2d693b2a (diff)
Fix ticket #1155. For compatibility with gallery2 increase the size of the tag name field from 64 bytes to 128 bytes.
-rw-r--r--installer/install.sql2
-rw-r--r--modules/tag/helpers/tag_installer.php12
-rw-r--r--modules/tag/module.info2
3 files changed, 12 insertions, 4 deletions
diff --git a/installer/install.sql b/installer/install.sql
index 2d0cac0f..0e09101e 100644
--- a/installer/install.sql
+++ b/installer/install.sql
@@ -309,7 +309,7 @@ DROP TABLE IF EXISTS {tags};
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE {tags} (
`id` int(9) NOT NULL AUTO_INCREMENT,
- `name` varchar(64) NOT NULL,
+ `name` varchar(128) NOT NULL,
`count` int(10) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`)
diff --git a/modules/tag/helpers/tag_installer.php b/modules/tag/helpers/tag_installer.php
index 6ccaf835..df6f0c65 100644
--- a/modules/tag/helpers/tag_installer.php
+++ b/modules/tag/helpers/tag_installer.php
@@ -22,7 +22,7 @@ class tag_installer {
$db = Database::instance();
$db->query("CREATE TABLE IF NOT EXISTS {tags} (
`id` int(9) NOT NULL auto_increment,
- `name` varchar(64) NOT NULL,
+ `name` varchar(128) NOT NULL,
`count` int(10) unsigned NOT NULL DEFAULT 0,
PRIMARY KEY (`id`),
UNIQUE KEY(`name`))
@@ -36,7 +36,15 @@ class tag_installer {
KEY(`tag_id`, `id`),
KEY(`item_id`, `id`))
DEFAULT CHARSET=utf8;");
- module::set_version("tag", 1);
+ module::set_version("tag", 2);
+ }
+
+ static function upgrade($version) {
+ $db = Database::instance();
+ if ($version == 1) {
+ $db->query("ALTER TABLE {tags} MODIFY COLUMN `name` VARCHAR(128)");
+ module::set_version("tag", $version = 2);
+ }
}
static function uninstall() {
diff --git a/modules/tag/module.info b/modules/tag/module.info
index e505dd81..8851d119 100644
--- a/modules/tag/module.info
+++ b/modules/tag/module.info
@@ -1,3 +1,3 @@
name = "Tags"
description = "Allows users to tag photos and albums"
-version = 1
+version = 2