Skip to content

Commit

Permalink
Fix automatic db updates; trigger contact indexing after upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
thomascube committed Aug 14, 2011
1 parent 782d859 commit faf10e8
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 5 deletions.
5 changes: 4 additions & 1 deletion SQL/mssql.upgrade.sql
Expand Up @@ -97,7 +97,10 @@ GO
ALTER TABLE [dbo].[contacts] ALTER COLUMN [email] [varchar] (255) COLLATE Latin1_General_CI_AI NOT NULL ALTER TABLE [dbo].[contacts] ALTER COLUMN [email] [varchar] (255) COLLATE Latin1_General_CI_AI NOT NULL
GO GO


-- Updates from version 0.5.X -- Updates from version 0.5.1
-- Updates from version 0.5.2
-- Updates from version 0.5.3
-- Updates from version 0.5.4


ALTER TABLE [dbo].[contacts] ADD [words] [text] COLLATE Latin1_General_CI_AI NULL ALTER TABLE [dbo].[contacts] ADD [words] [text] COLLATE Latin1_General_CI_AI NULL
GO GO
Expand Down
5 changes: 4 additions & 1 deletion SQL/mysql.update.sql
Expand Up @@ -133,7 +133,10 @@ ALTER TABLE `contacts` MODIFY `email` varchar(255) NOT NULL;


TRUNCATE TABLE `messages`; TRUNCATE TABLE `messages`;


-- Updates from version 0.5.X -- Updates from version 0.5.1
-- Updates from version 0.5.2
-- Updates from version 0.5.3
-- Updates from version 0.5.4


ALTER TABLE `contacts` ADD `words` TEXT NULL AFTER `vcard`; ALTER TABLE `contacts` ADD `words` TEXT NULL AFTER `vcard`;
ALTER TABLE `contacts` CHANGE `vcard` `vcard` LONGTEXT /*!40101 CHARACTER SET utf8 */ NULL DEFAULT NULL; ALTER TABLE `contacts` CHANGE `vcard` `vcard` LONGTEXT /*!40101 CHARACTER SET utf8 */ NULL DEFAULT NULL;
Expand Down
5 changes: 4 additions & 1 deletion SQL/postgres.update.sql
Expand Up @@ -90,7 +90,10 @@ ALTER TABLE contacts ALTER email TYPE varchar(255);


TRUNCATE messages; TRUNCATE messages;


-- Updates from version 0.5.X -- Updates from version 0.5.1
-- Updates from version 0.5.2
-- Updates from version 0.5.3
-- Updates from version 0.5.4


ALTER TABLE contacts ADD words TEXT NULL; ALTER TABLE contacts ADD words TEXT NULL;
CREATE INDEX contactgroupmembers_contact_id_idx ON contactgroupmembers (contact_id); CREATE INDEX contactgroupmembers_contact_id_idx ON contactgroupmembers (contact_id);
Expand Down
5 changes: 4 additions & 1 deletion SQL/sqlite.update.sql
Expand Up @@ -183,7 +183,10 @@ DROP TABLE contacts_tmp;
DELETE FROM messages; DELETE FROM messages;




-- Updates from version 0.5.X -- Updates from version 0.5.1
-- Updates from version 0.5.2
-- Updates from version 0.5.3
-- Updates from version 0.5.4


CREATE TABLE contacts_tmp ( CREATE TABLE contacts_tmp (
contact_id integer NOT NULL PRIMARY KEY, contact_id integer NOT NULL PRIMARY KEY,
Expand Down
3 changes: 2 additions & 1 deletion UPGRADING
Expand Up @@ -19,7 +19,8 @@ which should be updated. The update script will then copy all new files to the
target location and check and update the configuration and database schema. target location and check and update the configuration and database schema.
After all is done, the temporary folder with the new Roundcube files can be After all is done, the temporary folder with the new Roundcube files can be
removed again. removed again.
See Post-Upgrade Activities section.
Please also see Post-Upgrade Activities section.




Updating manually Updating manually
Expand Down
4 changes: 4 additions & 0 deletions bin/update.sh
Expand Up @@ -162,6 +162,10 @@ if ($RCI->configured) {
} }
} }


// index contacts for fulltext searching
if (version_compare($opts['version'], '0.6', '<')) {
system(INSTALL_PATH . 'bin/indexcontacts.sh');
}


if ($success) { if ($success) {
echo "This instance of Roundcube is up-to-date.\n"; echo "This instance of Roundcube is up-to-date.\n";
Expand Down

0 comments on commit faf10e8

Please sign in to comment.