summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2015-01-16 13:02:51 (GMT)
committerAleksander Machniak <machniak@kolabsys.com>2015-01-16 13:02:51 (GMT)
commitbd9b14e3c6934eda23809c345e7a2061fb42207c (patch)
tree24e9424a9e38ba7f73d82adb302947e9a2b4fccd /plugins
parent0dc0490ba02ebc695f7efd027f2b2af6f55ef1e1 (diff)
downloadroundcubemail-plugins-kolab-bd9b14e3c6934eda23809c345e7a2061fb42207c.tar.gz
Fix problem with disappearing events caused by DB errors (#4257)
Object "tags" string may for some object types be longer than 255 characters. Modified "tags" column type to text (clob in Oracle) for all kolab_cache_* tables.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/libkolab/SQL/mysql.initial.sql18
-rw-r--r--plugins/libkolab/SQL/mysql/2015011600.sql8
-rw-r--r--plugins/libkolab/SQL/oracle.initial.sql18
-rw-r--r--plugins/libkolab/SQL/oracle/2015011600.sql40
4 files changed, 66 insertions, 18 deletions
diff --git a/plugins/libkolab/SQL/mysql.initial.sql b/plugins/libkolab/SQL/mysql.initial.sql
index 2aa046d..98e7e78 100644
--- a/plugins/libkolab/SQL/mysql.initial.sql
+++ b/plugins/libkolab/SQL/mysql.initial.sql
@@ -31,7 +31,7 @@ CREATE TABLE `kolab_cache_contact` (
`changed` DATETIME DEFAULT NULL,
`data` LONGTEXT NOT NULL,
`xml` LONGBLOB NOT NULL,
- `tags` VARCHAR(255) NOT NULL,
+ `tags` TEXT NOT NULL,
`words` TEXT NOT NULL,
`type` VARCHAR(32) CHARACTER SET ascii NOT NULL,
`name` VARCHAR(255) NOT NULL,
@@ -55,7 +55,7 @@ CREATE TABLE `kolab_cache_event` (
`changed` DATETIME DEFAULT NULL,
`data` LONGTEXT NOT NULL,
`xml` LONGBLOB NOT NULL,
- `tags` VARCHAR(255) NOT NULL,
+ `tags` TEXT NOT NULL,
`words` TEXT NOT NULL,
`dtstart` DATETIME,
`dtend` DATETIME,
@@ -75,7 +75,7 @@ CREATE TABLE `kolab_cache_task` (
`changed` DATETIME DEFAULT NULL,
`data` LONGTEXT NOT NULL,
`xml` LONGBLOB NOT NULL,
- `tags` VARCHAR(255) NOT NULL,
+ `tags` TEXT NOT NULL,
`words` TEXT NOT NULL,
`dtstart` DATETIME,
`dtend` DATETIME,
@@ -95,7 +95,7 @@ CREATE TABLE `kolab_cache_journal` (
`changed` DATETIME DEFAULT NULL,
`data` LONGTEXT NOT NULL,
`xml` LONGBLOB NOT NULL,
- `tags` VARCHAR(255) NOT NULL,
+ `tags` TEXT NOT NULL,
`words` TEXT NOT NULL,
`dtstart` DATETIME,
`dtend` DATETIME,
@@ -115,7 +115,7 @@ CREATE TABLE `kolab_cache_note` (
`changed` DATETIME DEFAULT NULL,
`data` LONGTEXT NOT NULL,
`xml` LONGBLOB NOT NULL,
- `tags` VARCHAR(255) NOT NULL,
+ `tags` TEXT NOT NULL,
`words` TEXT NOT NULL,
CONSTRAINT `fk_kolab_cache_note_folder` FOREIGN KEY (`folder_id`)
REFERENCES `kolab_folders`(`folder_id`) ON DELETE CASCADE ON UPDATE CASCADE,
@@ -133,7 +133,7 @@ CREATE TABLE `kolab_cache_file` (
`changed` DATETIME DEFAULT NULL,
`data` LONGTEXT NOT NULL,
`xml` LONGBLOB NOT NULL,
- `tags` VARCHAR(255) NOT NULL,
+ `tags` TEXT NOT NULL,
`words` TEXT NOT NULL,
`filename` varchar(255) DEFAULT NULL,
CONSTRAINT `fk_kolab_cache_file_folder` FOREIGN KEY (`folder_id`)
@@ -153,7 +153,7 @@ CREATE TABLE `kolab_cache_configuration` (
`changed` DATETIME DEFAULT NULL,
`data` LONGTEXT NOT NULL,
`xml` LONGBLOB NOT NULL,
- `tags` VARCHAR(255) NOT NULL,
+ `tags` TEXT NOT NULL,
`words` TEXT NOT NULL,
`type` VARCHAR(32) CHARACTER SET ascii NOT NULL,
CONSTRAINT `fk_kolab_cache_configuration_folder` FOREIGN KEY (`folder_id`)
@@ -173,7 +173,7 @@ CREATE TABLE `kolab_cache_freebusy` (
`changed` DATETIME DEFAULT NULL,
`data` LONGTEXT NOT NULL,
`xml` LONGBLOB NOT NULL,
- `tags` VARCHAR(255) NOT NULL,
+ `tags` TEXT NOT NULL,
`words` TEXT NOT NULL,
`dtstart` DATETIME,
`dtend` DATETIME,
@@ -184,4 +184,4 @@ CREATE TABLE `kolab_cache_freebusy` (
) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
-INSERT INTO `system` (`name`, `value`) VALUES ('libkolab-version', '2014021000');
+INSERT INTO `system` (`name`, `value`) VALUES ('libkolab-version', '2015011600');
diff --git a/plugins/libkolab/SQL/mysql/2015011600.sql b/plugins/libkolab/SQL/mysql/2015011600.sql
new file mode 100644
index 0000000..be523ae
--- /dev/null
+++ b/plugins/libkolab/SQL/mysql/2015011600.sql
@@ -0,0 +1,8 @@
+ALTER TABLE `kolab_cache_contact` MODIFY `tags` text NOT NULL;
+ALTER TABLE `kolab_cache_event` MODIFY `tags` text NOT NULL;
+ALTER TABLE `kolab_cache_task` MODIFY `tags` text NOT NULL;
+ALTER TABLE `kolab_cache_journal` MODIFY `tags` text NOT NULL;
+ALTER TABLE `kolab_cache_note` MODIFY `tags` text NOT NULL;
+ALTER TABLE `kolab_cache_file` MODIFY `tags` text NOT NULL;
+ALTER TABLE `kolab_cache_configuration` MODIFY `tags` text NOT NULL;
+ALTER TABLE `kolab_cache_freebusy` MODIFY `tags` text NOT NULL;
diff --git a/plugins/libkolab/SQL/oracle.initial.sql b/plugins/libkolab/SQL/oracle.initial.sql
index 073dad5..8f1ed64 100644
--- a/plugins/libkolab/SQL/oracle.initial.sql
+++ b/plugins/libkolab/SQL/oracle.initial.sql
@@ -36,7 +36,7 @@ CREATE TABLE "kolab_cache_contact" (
"changed" timestamp DEFAULT NULL,
"data" clob NOT NULL,
"xml" clob NOT NULL,
- "tags" varchar(255) DEFAULT NULL,
+ "tags" clob DEFAULT NULL,
"words" clob DEFAULT NULL,
"type" varchar(32) NOT NULL,
"name" varchar(255) DEFAULT NULL,
@@ -59,7 +59,7 @@ CREATE TABLE "kolab_cache_event" (
"changed" timestamp DEFAULT NULL,
"data" clob NOT NULL,
"xml" clob NOT NULL,
- "tags" varchar(255) DEFAULT NULL,
+ "tags" clob DEFAULT NULL,
"words" clob DEFAULT NULL,
"dtstart" timestamp DEFAULT NULL,
"dtend" timestamp DEFAULT NULL,
@@ -78,7 +78,7 @@ CREATE TABLE "kolab_cache_task" (
"changed" timestamp DEFAULT NULL,
"data" clob NOT NULL,
"xml" clob NOT NULL,
- "tags" varchar(255) DEFAULT NULL,
+ "tags" clob DEFAULT NULL,
"words" clob DEFAULT NULL,
"dtstart" timestamp DEFAULT NULL,
"dtend" timestamp DEFAULT NULL,
@@ -97,7 +97,7 @@ CREATE TABLE "kolab_cache_journal" (
"changed" timestamp DEFAULT NULL,
"data" clob NOT NULL,
"xml" clob NOT NULL,
- "tags" varchar(255) DEFAULT NULL,
+ "tags" clob DEFAULT NULL,
"words" clob DEFAULT NULL,
"dtstart" timestamp DEFAULT NULL,
"dtend" timestamp DEFAULT NULL,
@@ -116,7 +116,7 @@ CREATE TABLE "kolab_cache_note" (
"changed" timestamp DEFAULT NULL,
"data" clob NOT NULL,
"xml" clob NOT NULL,
- "tags" varchar(255) DEFAULT NULL,
+ "tags" clob DEFAULT NULL,
"words" clob DEFAULT NULL,
PRIMARY KEY ("folder_id", "msguid")
);
@@ -133,7 +133,7 @@ CREATE TABLE "kolab_cache_file" (
"changed" timestamp DEFAULT NULL,
"data" clob NOT NULL,
"xml" clob NOT NULL,
- "tags" varchar(255) DEFAULT NULL,
+ "tags" clob DEFAULT NULL,
"words" clob DEFAULT NULL,
"filename" varchar(255) DEFAULT NULL,
PRIMARY KEY ("folder_id", "msguid")
@@ -152,7 +152,7 @@ CREATE TABLE "kolab_cache_configuration" (
"changed" timestamp DEFAULT NULL,
"data" clob NOT NULL,
"xml" clob NOT NULL,
- "tags" varchar(255) DEFAULT NULL,
+ "tags" clob DEFAULT NULL,
"words" clob DEFAULT NULL,
"type" varchar(32) NOT NULL,
PRIMARY KEY ("folder_id", "msguid")
@@ -171,7 +171,7 @@ CREATE TABLE "kolab_cache_freebusy" (
"changed" timestamp DEFAULT NULL,
"data" clob NOT NULL,
"xml" clob NOT NULL,
- "tags" varchar(255) DEFAULT NULL,
+ "tags" clob DEFAULT NULL,
"words" clob DEFAULT NULL,
"dtstart" timestamp DEFAULT NULL,
"dtend" timestamp DEFAULT NULL,
@@ -181,4 +181,4 @@ CREATE TABLE "kolab_cache_freebusy" (
CREATE INDEX "kolab_cache_fb_uid2msguid" ON "kolab_cache_freebusy" ("folder_id", "uid", "msguid");
-INSERT INTO "system" ("name", "value") VALUES ('libkolab-version', '2014021000');
+INSERT INTO "system" ("name", "value") VALUES ('libkolab-version', '2015011600');
diff --git a/plugins/libkolab/SQL/oracle/2015011600.sql b/plugins/libkolab/SQL/oracle/2015011600.sql
new file mode 100644
index 0000000..69f7953
--- /dev/null
+++ b/plugins/libkolab/SQL/oracle/2015011600.sql
@@ -0,0 +1,40 @@
+-- direct change from varchar to clob does not work, need temp column (#4257)
+ALTER TABLE "kolab_cache_contact" ADD "tags1" clob DEFAULT NULL;
+UPDATE "kolab_cache_contact" SET "tags1" = "tags";
+ALTER TABLE "kolab_cache_contact" DROP COLUMN "tags";
+ALTER TABLE "kolab_cache_contact" RENAME COLUMN "tags1" TO "tags";
+
+ALTER TABLE "kolab_cache_event" ADD "tags1" clob DEFAULT NULL;
+UPDATE "kolab_cache_event" SET "tags1" = "tags";
+ALTER TABLE "kolab_cache_event" DROP COLUMN "tags";
+ALTER TABLE "kolab_cache_event" RENAME COLUMN "tags1" TO "tags";
+
+ALTER TABLE "kolab_cache_task" ADD "tags1" clob DEFAULT NULL;
+UPDATE "kolab_cache_task" SET "tags1" = "tags";
+ALTER TABLE "kolab_cache_task" DROP COLUMN "tags";
+ALTER TABLE "kolab_cache_task" RENAME COLUMN "tags1" TO "tags";
+
+ALTER TABLE "kolab_cache_journal" ADD "tags1" clob DEFAULT NULL;
+UPDATE "kolab_cache_journal" SET "tags1" = "tags";
+ALTER TABLE "kolab_cache_journal" DROP COLUMN "tags";
+ALTER TABLE "kolab_cache_journal" RENAME COLUMN "tags1" TO "tags";
+
+ALTER TABLE "kolab_cache_note" ADD "tags1" clob DEFAULT NULL;
+UPDATE "kolab_cache_note" SET "tags1" = "tags";
+ALTER TABLE "kolab_cache_note" DROP COLUMN "tags";
+ALTER TABLE "kolab_cache_note" RENAME COLUMN "tags1" TO "tags";
+
+ALTER TABLE "kolab_cache_file" ADD "tags1" clob DEFAULT NULL;
+UPDATE "kolab_cache_file" SET "tags1" = "tags";
+ALTER TABLE "kolab_cache_file" DROP COLUMN "tags";
+ALTER TABLE "kolab_cache_file" RENAME COLUMN "tags1" TO "tags";
+
+ALTER TABLE "kolab_cache_configuration" ADD "tags1" clob DEFAULT NULL;
+UPDATE "kolab_cache_configuration" SET "tags1" = "tags";
+ALTER TABLE "kolab_cache_configuration" DROP COLUMN "tags";
+ALTER TABLE "kolab_cache_configuration" RENAME COLUMN "tags1" TO "tags";
+
+ALTER TABLE "kolab_cache_freebusy" ADD "tags1" clob DEFAULT NULL;
+UPDATE "kolab_cache_freebusy" SET "tags1" = "tags";
+ALTER TABLE "kolab_cache_freebusy" DROP COLUMN "tags";
+ALTER TABLE "kolab_cache_freebusy" RENAME COLUMN "tags1" TO "tags";