From 15792c4ddfec9741324c6968cc3e70fb23cef8ad Mon Sep 17 00:00:00 2001
From: Joe7 <jozsef.rnagy@site.hu>
Date: Mon, 27 Dec 2010 22:16:29 +0100
Subject: Added changes to installer and upgrader scripts to support INSERT ON
 DUPLICATE KEY UPDATE SYNTAX in cache lib

---
 installer/install.sql | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'installer/install.sql')

diff --git a/installer/install.sql b/installer/install.sql
index 427a3283..baee2b9d 100644
--- a/installer/install.sql
+++ b/installer/install.sql
@@ -43,7 +43,7 @@ CREATE TABLE {caches} (
   `expiration` int(9) NOT NULL,
   `cache` longblob,
   PRIMARY KEY (`id`),
-  KEY `key` (`key`),
+  UNIQUE KEY `key` (`key`),
   KEY `tags` (`tags`)
 ) DEFAULT CHARSET=utf8;
 /*!40101 SET character_set_client = @saved_cs_client */;
-- 
cgit v1.2.3


From affbc28876901058810d9fd26a8f7795084f2efd Mon Sep 17 00:00:00 2001
From: Bharat Mediratta <bharat@menalto.com>
Date: Fri, 31 Dec 2010 22:29:00 -0800
Subject: Update gallery module to v42 to reflect key changes in the cache
 table in 440597356d8719bdc6733d2d86aaef5f86d05a1e for #1559.

---
 installer/install.sql | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'installer/install.sql')

diff --git a/installer/install.sql b/installer/install.sql
index baee2b9d..2a2bf269 100644
--- a/installer/install.sql
+++ b/installer/install.sql
@@ -43,7 +43,7 @@ CREATE TABLE {caches} (
   `expiration` int(9) NOT NULL,
   `cache` longblob,
   PRIMARY KEY (`id`),
-  UNIQUE KEY `key` (`key`),
+  KEY `key` (`key`),
   KEY `tags` (`tags`)
 ) DEFAULT CHARSET=utf8;
 /*!40101 SET character_set_client = @saved_cs_client */;
@@ -244,7 +244,7 @@ CREATE TABLE {modules} (
   KEY `weight` (`weight`)
 ) AUTO_INCREMENT=11 DEFAULT CHARSET=utf8;
 /*!40101 SET character_set_client = @saved_cs_client */;
-INSERT INTO {modules} VALUES (1,1,'gallery',41,1);
+INSERT INTO {modules} VALUES (1,1,'gallery',42,1);
 INSERT INTO {modules} VALUES (2,1,'user',3,2);
 INSERT INTO {modules} VALUES (3,1,'comment',3,3);
 INSERT INTO {modules} VALUES (4,1,'organize',2,4);
-- 
cgit v1.2.3


From b26eff7f23b970a7983baf5e211ba88968effb9d Mon Sep 17 00:00:00 2001
From: Joe7 <jozsef.rnagy@site.hu>
Date: Mon, 3 Jan 2011 15:44:36 +0100
Subject: Bugfix: input validation validates description up to length of 65535
 chars, but DB trimmed data over 2048 chars. Converting column into TEXT type.
 Note: The effective maximum length of a VARCHAR in MySQL 5.0.3 and later is
 subject to the maximum row size (65,535 bytes, which is shared among all
 columns) and the character set used. In contrast to CHAR, VARCHAR values are
 stored as a one-byte or two-byte length prefix plus data. The length prefix
 indicates the number of bytes in the value. A column uses one length byte if
 values require no more than 255 bytes, two length bytes if values may require
 more than 255 bytes.

---
 installer/install.sql                         | 2 +-
 modules/gallery/helpers/gallery_installer.php | 7 ++++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

(limited to 'installer/install.sql')

diff --git a/installer/install.sql b/installer/install.sql
index 2a2bf269..7a0f99c4 100644
--- a/installer/install.sql
+++ b/installer/install.sql
@@ -152,7 +152,7 @@ CREATE TABLE {items} (
   `album_cover_item_id` int(9) DEFAULT NULL,
   `captured` int(9) DEFAULT NULL,
   `created` int(9) DEFAULT NULL,
-  `description` varchar(2048) DEFAULT NULL,
+  `description` TEXT DEFAULT NULL,
   `height` int(9) DEFAULT NULL,
   `left_ptr` int(9) NOT NULL,
   `level` int(9) NOT NULL,
diff --git a/modules/gallery/helpers/gallery_installer.php b/modules/gallery/helpers/gallery_installer.php
index cb314527..90d6d4b7 100644
--- a/modules/gallery/helpers/gallery_installer.php
+++ b/modules/gallery/helpers/gallery_installer.php
@@ -309,7 +309,7 @@ class gallery_installer {
     module::set_var("gallery", "show_user_profiles_to", "registered_users");
     module::set_var("gallery", "extra_binary_paths", "/usr/local/bin:/opt/local/bin:/opt/bin");
 
-    module::set_version("gallery", 42);
+    module::set_version("gallery", 43);
   }
 
   static function upgrade($version) {
@@ -648,6 +648,11 @@ class gallery_installer {
       $db->query("ALTER TABLE {caches} DROP INDEX `key`, ADD UNIQUE `key` (`key`)");
       module::set_version("gallery", $version = 42);
     }
+
+    if ($version == 42) {
+      $db->query("ALTER TABLE {items} CHANGE `description` `description` TEXT DEFAULT NULL");
+      module::set_version("gallery", $version = 43);
+    }
   }
 
   static function uninstall() {
-- 
cgit v1.2.3


From 70ac063c5590572d1a074632e9e06558951eaf52 Mon Sep 17 00:00:00 2001
From: Joe7 <jozsef.rnagy@site.hu>
Date: Mon, 3 Jan 2011 19:49:13 +0100
Subject: case fix

---
 installer/install.sql | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'installer/install.sql')

diff --git a/installer/install.sql b/installer/install.sql
index 7a0f99c4..c398d130 100644
--- a/installer/install.sql
+++ b/installer/install.sql
@@ -152,7 +152,7 @@ CREATE TABLE {items} (
   `album_cover_item_id` int(9) DEFAULT NULL,
   `captured` int(9) DEFAULT NULL,
   `created` int(9) DEFAULT NULL,
-  `description` TEXT DEFAULT NULL,
+  `description` text DEFAULT NULL,
   `height` int(9) DEFAULT NULL,
   `left_ptr` int(9) NOT NULL,
   `level` int(9) NOT NULL,
-- 
cgit v1.2.3


From 8263cb023fb4fe0b6fdc9fc61b35518dcf09946e Mon Sep 17 00:00:00 2001
From: Bharat Mediratta <bharat@menalto.com>
Date: Mon, 3 Jan 2011 11:14:58 -0800
Subject: Updated installer for the bump of the gallery module to v43.  Fixes
 #1568.

---
 installer/install.sql | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'installer/install.sql')

diff --git a/installer/install.sql b/installer/install.sql
index c398d130..84a975ae 100644
--- a/installer/install.sql
+++ b/installer/install.sql
@@ -152,7 +152,7 @@ CREATE TABLE {items} (
   `album_cover_item_id` int(9) DEFAULT NULL,
   `captured` int(9) DEFAULT NULL,
   `created` int(9) DEFAULT NULL,
-  `description` text DEFAULT NULL,
+  `description` varchar(2048) DEFAULT NULL,
   `height` int(9) DEFAULT NULL,
   `left_ptr` int(9) NOT NULL,
   `level` int(9) NOT NULL,
@@ -244,7 +244,7 @@ CREATE TABLE {modules} (
   KEY `weight` (`weight`)
 ) AUTO_INCREMENT=11 DEFAULT CHARSET=utf8;
 /*!40101 SET character_set_client = @saved_cs_client */;
-INSERT INTO {modules} VALUES (1,1,'gallery',42,1);
+INSERT INTO {modules} VALUES (1,1,'gallery',43,1);
 INSERT INTO {modules} VALUES (2,1,'user',3,2);
 INSERT INTO {modules} VALUES (3,1,'comment',3,3);
 INSERT INTO {modules} VALUES (4,1,'organize',2,4);
-- 
cgit v1.2.3


From d74aad072d8ccca70efb1c8b673e8368566a1974 Mon Sep 17 00:00:00 2001
From: Bharat Mediratta <bharat@menalto.com>
Date: Mon, 3 Jan 2011 12:25:51 -0800
Subject: Some small follow on fixes for #1559 and #1568: 1) Make database
 changes in gallery_installer::install() instead of    in installer/install.ql
 2) Bump the version number in modules/gallery/module.info

---
 installer/install.sql                         | 4 ++--
 modules/gallery/helpers/gallery_installer.php | 4 ++--
 modules/gallery/module.info                   | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

(limited to 'installer/install.sql')

diff --git a/installer/install.sql b/installer/install.sql
index 84a975ae..6aae8014 100644
--- a/installer/install.sql
+++ b/installer/install.sql
@@ -43,7 +43,7 @@ CREATE TABLE {caches} (
   `expiration` int(9) NOT NULL,
   `cache` longblob,
   PRIMARY KEY (`id`),
-  KEY `key` (`key`),
+  UNIQUE KEY `key` (`key`),
   KEY `tags` (`tags`)
 ) DEFAULT CHARSET=utf8;
 /*!40101 SET character_set_client = @saved_cs_client */;
@@ -152,7 +152,7 @@ CREATE TABLE {items} (
   `album_cover_item_id` int(9) DEFAULT NULL,
   `captured` int(9) DEFAULT NULL,
   `created` int(9) DEFAULT NULL,
-  `description` varchar(2048) DEFAULT NULL,
+  `description` text,
   `height` int(9) DEFAULT NULL,
   `left_ptr` int(9) NOT NULL,
   `level` int(9) NOT NULL,
diff --git a/modules/gallery/helpers/gallery_installer.php b/modules/gallery/helpers/gallery_installer.php
index 834a27fa..f7b8da5f 100644
--- a/modules/gallery/helpers/gallery_installer.php
+++ b/modules/gallery/helpers/gallery_installer.php
@@ -44,7 +44,7 @@ class gallery_installer {
                 `expiration` int(9) NOT NULL,
                 `cache` longblob,
                 PRIMARY KEY (`id`),
-                KEY (`key`),
+                UNIQUE KEY (`key`),
                 KEY (`tags`))
                 DEFAULT CHARSET=utf8;");
 
@@ -84,7 +84,7 @@ class gallery_installer {
                  `album_cover_item_id` int(9) default NULL,
                  `captured` int(9) default NULL,
                  `created` int(9) default NULL,
-                 `description` varchar(2048) default NULL,
+                 `description` text default NULL,
                  `height` int(9) default NULL,
                  `left_ptr` int(9) NOT NULL,
                  `level` int(9) NOT NULL,
diff --git a/modules/gallery/module.info b/modules/gallery/module.info
index 0cc3f6d1..eb579ab6 100644
--- a/modules/gallery/module.info
+++ b/modules/gallery/module.info
@@ -1,3 +1,3 @@
 name = "Gallery 3"
 description = "Gallery core application"
-version = 42
+version = 43
-- 
cgit v1.2.3

