diff --git a/CHANGELOG b/CHANGELOG index db6c4af25..7565a1185 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,7 @@ CHANGELOG Roundcube Webmail =========================== +- Fix problem with contactgroupmembers table creation on MySQL 4.x, add index on contact_id column - Add LDAP SASL bind and proxy authentication (#1486692) - Add variable for 'Today' label in date_today option (#1486120) - Fix dont_override setting does not override existing user preferences (#1487664) diff --git a/SQL/mssql.initial.sql b/SQL/mssql.initial.sql index 4e31c07d0..4aa6fc9f7 100644 --- a/SQL/mssql.initial.sql +++ b/SQL/mssql.initial.sql @@ -195,6 +195,8 @@ ALTER TABLE [dbo].[contactgroupmembers] ADD CONSTRAINT [DF_contactgroupmembers_created] DEFAULT (getdate()) FOR [created] GO +CREATE INDEX [IX_contactgroupmembers_contact_id] ON [dbo].[contactgroupmembers]([contact_id]) ON [PRIMARY] +GO ALTER TABLE [dbo].[identities] ADD CONSTRAINT [DF_identities_user] DEFAULT ('0') FOR [user_id], diff --git a/SQL/mssql.upgrade.sql b/SQL/mssql.upgrade.sql index 3d067924c..8534afdd3 100644 --- a/SQL/mssql.upgrade.sql +++ b/SQL/mssql.upgrade.sql @@ -101,3 +101,5 @@ GO ALTER TABLE [dbo].[contacts] ADD [words] [text] COLLATE Latin1_General_CI_AI NULL GO +CREATE INDEX [IX_contactgroupmembers_contact_id] ON [dbo].[contactgroupmembers]([contact_id]) ON [PRIMARY] +GO diff --git a/SQL/mysql.initial.sql b/SQL/mysql.initial.sql index accf212d4..8e2e61c9e 100644 --- a/SQL/mysql.initial.sql +++ b/SQL/mysql.initial.sql @@ -117,7 +117,8 @@ CREATE TABLE `contactgroupmembers` ( CONSTRAINT `contactgroup_id_fk_contactgroups` FOREIGN KEY (`contactgroup_id`) REFERENCES `contactgroups`(`contactgroup_id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `contact_id_fk_contacts` FOREIGN KEY (`contact_id`) - REFERENCES `contacts`(`contact_id`) ON DELETE CASCADE ON UPDATE CASCADE + REFERENCES `contacts`(`contact_id`) ON DELETE CASCADE ON UPDATE CASCADE, + INDEX `contactgroupmembers_contact_index` (`contact_id`) ) /*!40000 ENGINE=INNODB */; diff --git a/SQL/mysql.update.sql b/SQL/mysql.update.sql index f6c8d7869..d30f037c6 100644 --- a/SQL/mysql.update.sql +++ b/SQL/mysql.update.sql @@ -136,3 +136,5 @@ TRUNCATE TABLE `messages`; -- Updates from version 0.5.* ALTER TABLE `contacts` ADD `words` TEXT NULL AFTER `vcard`; +ALTER TABLE `contactgroupmembers` ADD INDEX `contactgroupmembers_contact_index` (`contact_id`); + \ No newline at end of file diff --git a/SQL/postgres.initial.sql b/SQL/postgres.initial.sql index f52ebd572..b273bcb0b 100644 --- a/SQL/postgres.initial.sql +++ b/SQL/postgres.initial.sql @@ -157,6 +157,8 @@ CREATE TABLE contactgroupmembers ( PRIMARY KEY (contactgroup_id, contact_id) ); +CREATE INDEX contactgroupmembers_contact_id_idx ON contactgroupmembers (contact_id); + -- -- Sequence "cache_ids" -- Name: cache_ids; Type: SEQUENCE; Schema: public; Owner: postgres diff --git a/SQL/postgres.update.sql b/SQL/postgres.update.sql index 6c3838868..e3eb581f9 100644 --- a/SQL/postgres.update.sql +++ b/SQL/postgres.update.sql @@ -90,8 +90,7 @@ ALTER TABLE contacts ALTER email TYPE varchar(255); TRUNCATE messages; - -- Updates from version 0.5.x ALTER TABLE contacts ADD words TEXT NULL; - +CREATE INDEX contactgroupmembers_contact_id_idx ON contactgroupmembers (contact_id); diff --git a/SQL/sqlite.initial.sql b/SQL/sqlite.initial.sql index 3aacccb95..d2885e968 100644 --- a/SQL/sqlite.initial.sql +++ b/SQL/sqlite.initial.sql @@ -56,6 +56,8 @@ CREATE TABLE contactgroupmembers ( PRIMARY KEY (contactgroup_id, contact_id) ); +CREATE INDEX ix_contactgroupmembers_contact_id ON contactgroupmembers (contact_id); + -- -------------------------------------------------------- diff --git a/SQL/sqlite.update.sql b/SQL/sqlite.update.sql index 46373d8b0..7b5464c64 100644 --- a/SQL/sqlite.update.sql +++ b/SQL/sqlite.update.sql @@ -221,3 +221,4 @@ CREATE INDEX ix_contacts_user_id ON contacts(user_id, email); DROP TABLE contacts_tmp; DELETE FROM messages; +CREATE INDEX ix_contactgroupmembers_contact_id ON contactgroupmembers (contact_id);