summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2013-04-28 12:38:35 (GMT)
committerAleksander Machniak <machniak@kolabsys.com>2013-04-28 12:38:35 (GMT)
commite80b7ae73c46a2684d743356a70a973032fb1158 (patch)
treed13e9b999c46dc4c83d2ed50d8d1700dbb1c9360
parentaf91c596bde84b9955e1ba196debce48acf2f555 (diff)
downloadroundcubemail-plugins-kolab-e80b7ae73c46a2684d743356a70a973032fb1158.tar.gz
Fix sequence names in postgres database after changes in core
-rw-r--r--plugins/calendar/drivers/database/SQL/mysql.initial.sql2
-rw-r--r--plugins/calendar/drivers/database/SQL/mysql/2013042700.sql1
-rw-r--r--plugins/calendar/drivers/database/SQL/postgres.initial.sql14
-rw-r--r--plugins/calendar/drivers/database/SQL/postgres/2013042700.sql8
-rw-r--r--plugins/calendar/drivers/database/SQL/sqlite.initial.sql2
-rw-r--r--plugins/calendar/drivers/database/SQL/sqlite/2013042700.sql1
6 files changed, 19 insertions, 9 deletions
diff --git a/plugins/calendar/drivers/database/SQL/mysql.initial.sql b/plugins/calendar/drivers/database/SQL/mysql.initial.sql
index ac58f7f..f7bf9b5 100644
--- a/plugins/calendar/drivers/database/SQL/mysql.initial.sql
+++ b/plugins/calendar/drivers/database/SQL/mysql.initial.sql
@@ -79,4 +79,4 @@ CREATE TABLE `itipinvitations` (
REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE
) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
-INSERT INTO system (name, value) VALUES ('calendar-database-version', '2013011000');
+INSERT INTO system (name, value) VALUES ('calendar-database-version', '2013042700');
diff --git a/plugins/calendar/drivers/database/SQL/mysql/2013042700.sql b/plugins/calendar/drivers/database/SQL/mysql/2013042700.sql
new file mode 100644
index 0000000..fe6741a
--- /dev/null
+++ b/plugins/calendar/drivers/database/SQL/mysql/2013042700.sql
@@ -0,0 +1 @@
+-- empty \ No newline at end of file
diff --git a/plugins/calendar/drivers/database/SQL/postgres.initial.sql b/plugins/calendar/drivers/database/SQL/postgres.initial.sql
index 5dfd952..bc8962b 100644
--- a/plugins/calendar/drivers/database/SQL/postgres.initial.sql
+++ b/plugins/calendar/drivers/database/SQL/postgres.initial.sql
@@ -14,14 +14,14 @@
**/
-CREATE SEQUENCE calendar_ids
+CREATE SEQUENCE calendars_seq
INCREMENT BY 1
NO MAXVALUE
NO MINVALUE
CACHE 1;
CREATE TABLE calendars (
- calendar_id integer DEFAULT nextval('calendar_ids'::regclass) NOT NULL,
+ calendar_id integer DEFAULT nextval('calendars_seq'::regclass) NOT NULL,
user_id integer NOT NULL
REFERENCES users (user_id) ON UPDATE CASCADE ON DELETE CASCADE,
name varchar(255) NOT NULL,
@@ -33,14 +33,14 @@ CREATE TABLE calendars (
CREATE INDEX calendars_user_id_idx ON calendars (user_id, name);
-CREATE SEQUENCE event_ids
+CREATE SEQUENCE events_seq
INCREMENT BY 1
NO MAXVALUE
NO MINVALUE
CACHE 1;
CREATE TABLE events (
- event_id integer DEFAULT nextval('event_ids'::regclass) NOT NULL,
+ event_id integer DEFAULT nextval('events_seq'::regclass) NOT NULL,
calendar_id integer NOT NULL
REFERENCES calendars (calendar_id) ON UPDATE CASCADE ON DELETE CASCADE,
recurrence_id integer NOT NULL DEFAULT 0,
@@ -70,14 +70,14 @@ CREATE INDEX events_uid_idx ON events (uid);
CREATE INDEX events_recurrence_id_idx ON events (recurrence_id);
-CREATE SEQUENCE attachment_ids
+CREATE SEQUENCE attachments_seq
INCREMENT BY 1
NO MAXVALUE
NO MINVALUE
CACHE 1;
CREATE TABLE attachments (
- attachment_id integer DEFAULT nextval('attachment_ids'::regclass) NOT NULL,
+ attachment_id integer DEFAULT nextval('attachments_seq'::regclass) NOT NULL,
event_id integer NOT NULL
REFERENCES events (event_id) ON DELETE CASCADE ON UPDATE CASCADE,
filename varchar(255) NOT NULL DEFAULT '',
@@ -103,4 +103,4 @@ CREATE TABLE itipinvitations (
CREATE INDEX itipinvitations_user_id_event_uid_idx ON itipinvitations (user_id, event_uid);
-INSERT INTO system (name, value) VALUES ('calendar-database-version', '2013011000');
+INSERT INTO system (name, value) VALUES ('calendar-database-version', '2013042700');
diff --git a/plugins/calendar/drivers/database/SQL/postgres/2013042700.sql b/plugins/calendar/drivers/database/SQL/postgres/2013042700.sql
new file mode 100644
index 0000000..d644c39
--- /dev/null
+++ b/plugins/calendar/drivers/database/SQL/postgres/2013042700.sql
@@ -0,0 +1,8 @@
+ALTER SEQUENCE calendar_ids RENAME TO calendars_seq;
+ALTER TABLE calendars ALTER COLUMN calendar_id SET DEFAULT nextval('calendars_seq'::text);
+
+ALTER SEQUENCE event_ids RENAME TO events_seq;
+ALTER TABLE events ALTER COLUMN event_id SET DEFAULT nextval('events_seq'::text);
+
+ALTER SEQUENCE attachment_ids RENAME TO attachments_seq;
+ALTER TABLE attachments ALTER COLUMN attachment_id SET DEFAULT nextval('attachments_seq'::text);
diff --git a/plugins/calendar/drivers/database/SQL/sqlite.initial.sql b/plugins/calendar/drivers/database/SQL/sqlite.initial.sql
index 778b0bf..a9a9d7e 100644
--- a/plugins/calendar/drivers/database/SQL/sqlite.initial.sql
+++ b/plugins/calendar/drivers/database/SQL/sqlite.initial.sql
@@ -73,4 +73,4 @@ CREATE TABLE itipinvitations (
CREATE INDEX ix_itipinvitations_uid ON itipinvitations(user_id, event_uid);
-INSERT INTO system (name, value) VALUES ('calendar-database-version', '2013011000');
+INSERT INTO system (name, value) VALUES ('calendar-database-version', '2013042700');
diff --git a/plugins/calendar/drivers/database/SQL/sqlite/2013042700.sql b/plugins/calendar/drivers/database/SQL/sqlite/2013042700.sql
new file mode 100644
index 0000000..fe6741a
--- /dev/null
+++ b/plugins/calendar/drivers/database/SQL/sqlite/2013042700.sql
@@ -0,0 +1 @@
+-- empty \ No newline at end of file