[Svn] r3333 - in trunk/roundcubemail: . SQL

trac at roundcube.net trac at roundcube.net
Sat Mar 6 15:13:25 CET 2010


Author: alec
Date: 2010-03-06 08:13:25 -0600 (Sat, 06 Mar 2010)
New Revision: 3333

Modified:
   trunk/roundcubemail/INSTALL
   trunk/roundcubemail/SQL/mysql.initial.sql
   trunk/roundcubemail/SQL/mysql.update.sql
   trunk/roundcubemail/SQL/postgres.initial.sql
   trunk/roundcubemail/SQL/postgres.update.sql
   trunk/roundcubemail/SQL/sqlite.initial.sql
   trunk/roundcubemail/SQL/sqlite.update.sql
Log:
- re-fix (#1486474) + require MySQL 4.0.8 + add index/update in identities table


Modified: trunk/roundcubemail/INSTALL
===================================================================
--- trunk/roundcubemail/INSTALL	2010-03-06 12:43:38 UTC (rev 3332)
+++ trunk/roundcubemail/INSTALL	2010-03-06 14:13:25 UTC (rev 3333)
@@ -28,7 +28,8 @@
    - suhosin.session.encrypt disabled
    - mbstring.func_overload disabled
 * PHP compiled with OpenSSL to connect to IMAPS and to use the spell checker
-* A MySQL, PostgreSQL or MSSQL database engine or the SQLite extension for PHP
+* A MySQL (4.0.8 or newer), PostgreSQL, MSSQL database engine
+  or the SQLite extension for PHP
 * One of the above databases with permission to create tables
 * An SMTP server (recommended) or PHP configured for mail delivery
 

Modified: trunk/roundcubemail/SQL/mysql.initial.sql
===================================================================
--- trunk/roundcubemail/SQL/mysql.initial.sql	2010-03-06 12:43:38 UTC (rev 3332)
+++ trunk/roundcubemail/SQL/mysql.initial.sql	2010-03-06 14:13:25 UTC (rev 3333)
@@ -52,16 +52,14 @@
  `headers` text NOT NULL,
  `structure` text,
  PRIMARY KEY(`message_id`),
+ CONSTRAINT `user_id_fk_messages` FOREIGN KEY (`user_id`)
+   REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  INDEX `created_index` (`created`),
  INDEX `index_index` (`user_id`, `cache_key`, `idx`),
  UNIQUE `uniqueness` (`user_id`, `cache_key`, `uid`)
 ) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
 
-/* create foreign keys outside of create table, because of MySQL bug #46293 */
-ALTER TABLE `messages` ADD CONSTRAINT `user_id_fk_messages` FOREIGN KEY (`user_id`)
- REFERENCES `users`(`user_id`) /*!40008 ON DELETE CASCADE ON UPDATE CASCADE */;
 
-
 -- Table structure for table `cache`
 
 CREATE TABLE `cache` (
@@ -71,15 +69,13 @@
  `data` longtext NOT NULL,
  `user_id` int(10) UNSIGNED NOT NULL DEFAULT '0',
  PRIMARY KEY(`cache_id`),
+ CONSTRAINT `user_id_fk_cache` FOREIGN KEY (`user_id`)
+   REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  INDEX `created_index` (`created`),
  INDEX `user_cache_index` (`user_id`,`cache_key`)
 ) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
 
-/* create foreign keys outside of create table, because of MySQL bug #46293 */
-ALTER TABLE `cache` ADD CONSTRAINT `user_id_fk_cache` FOREIGN KEY (`user_id`)
- REFERENCES `users`(`user_id`) /*!40008 ON DELETE CASCADE ON UPDATE CASCADE */;
 
-
 -- Table structure for table `contacts`
 
 CREATE TABLE `contacts` (
@@ -93,14 +89,12 @@
  `vcard` text NULL,
  `user_id` int(10) UNSIGNED NOT NULL DEFAULT '0',
  PRIMARY KEY(`contact_id`),
+ CONSTRAINT `user_id_fk_contacts` FOREIGN KEY (`user_id`)
+   REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  INDEX `user_contacts_index` (`user_id`,`email`)
 ) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
 
-/* create foreign keys outside of create table, because of MySQL bug #46293 */
-ALTER TABLE `contacts` ADD CONSTRAINT `user_id_fk_contacts` FOREIGN KEY (`user_id`)
- REFERENCES `users`(`user_id`) /*!40008 ON DELETE CASCADE ON UPDATE CASCADE */;
 
-
 -- Table structure for table `identities`
 
 CREATE TABLE `identities` (
@@ -115,12 +109,11 @@
  `signature` text,
  `html_signature` tinyint(1) NOT NULL DEFAULT '0',
  `user_id` int(10) UNSIGNED NOT NULL DEFAULT '0',
- PRIMARY KEY(`identity_id`)
+ PRIMARY KEY(`identity_id`),
+ CONSTRAINT `user_id_fk_identities` FOREIGN KEY (`user_id`)
+   REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ INDEX `user_identities_index` (`user_id`, `del`)
 ) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
 
-/* create foreign keys outside of create table, because of MySQL bug #46293 */
-ALTER TABLE `identities` ADD CONSTRAINT `user_id_fk_identities` FOREIGN KEY (`user_id`)
- REFERENCES `users`(`user_id`) /*!40008 ON DELETE CASCADE ON UPDATE CASCADE */;
 
-
 /*!40014 SET FOREIGN_KEY_CHECKS=1 */;

Modified: trunk/roundcubemail/SQL/mysql.update.sql
===================================================================
--- trunk/roundcubemail/SQL/mysql.update.sql	2010-03-06 12:43:38 UTC (rev 3332)
+++ trunk/roundcubemail/SQL/mysql.update.sql	2010-03-06 14:13:25 UTC (rev 3333)
@@ -69,16 +69,18 @@
 ALTER TABLE `identities` DROP FOREIGN KEY `user_id_fk_identities`;
 
 ALTER TABLE `messages` ADD CONSTRAINT `user_id_fk_messages` FOREIGN KEY (`user_id`)
- REFERENCES `users`(`user_id`) /*!40008 ON DELETE CASCADE ON UPDATE CASCADE */;
+ REFERENCES `users`(`user_id`);
 ALTER TABLE `cache` ADD CONSTRAINT `user_id_fk_cache` FOREIGN KEY (`user_id`)
- REFERENCES `users`(`user_id`) /*!40008 ON DELETE CASCADE ON UPDATE CASCADE */;
+ REFERENCES `users`(`user_id`);
 ALTER TABLE `contacts` ADD CONSTRAINT `user_id_fk_contacts` FOREIGN KEY (`user_id`)
- REFERENCES `users`(`user_id`) /*!40008 ON DELETE CASCADE ON UPDATE CASCADE */;
+ REFERENCES `users`(`user_id`);
 ALTER TABLE `identities` ADD CONSTRAINT `user_id_fk_identities` FOREIGN KEY (`user_id`)
- REFERENCES `users`(`user_id`) /*!40008 ON DELETE CASCADE ON UPDATE CASCADE */;
+ REFERENCES `users`(`user_id`);
 
 ALTER TABLE `contacts` ALTER `name` SET DEFAULT '';
 ALTER TABLE `contacts` ALTER `firstname` SET DEFAULT '';
 ALTER TABLE `contacts` ALTER `surname` SET DEFAULT '';
 
+ALTER TABLE `identities` INDEX `user_identities_index` (`user_id`, `del`);
+
 /*!40014 SET FOREIGN_KEY_CHECKS=1 */;

Modified: trunk/roundcubemail/SQL/postgres.initial.sql
===================================================================
--- trunk/roundcubemail/SQL/postgres.initial.sql	2010-03-06 12:43:38 UTC (rev 3332)
+++ trunk/roundcubemail/SQL/postgres.initial.sql	2010-03-06 14:13:25 UTC (rev 3333)
@@ -78,7 +78,7 @@
     html_signature integer DEFAULT 0 NOT NULL
 );
 
-CREATE INDEX identities_user_id_idx ON identities (user_id);
+CREATE INDEX identities_user_id_idx ON identities (user_id, del);
 
 
 --

Modified: trunk/roundcubemail/SQL/postgres.update.sql
===================================================================
--- trunk/roundcubemail/SQL/postgres.update.sql	2010-03-06 12:43:38 UTC (rev 3332)
+++ trunk/roundcubemail/SQL/postgres.update.sql	2010-03-06 14:13:25 UTC (rev 3333)
@@ -43,3 +43,8 @@
 CREATE INDEX messages_index_idx ON messages (user_id, cache_key, idx);
 DROP INDEX contacts_user_id_idx;
 CREATE INDEX contacts_user_id_idx ON contacts (user_id, email);
+
+-- Updates from version 0.3.1
+
+DROP INDEX identities_user_id_idx;
+CREATE INDEX identities_user_id_idx ON identities (user_id, del);

Modified: trunk/roundcubemail/SQL/sqlite.initial.sql
===================================================================
--- trunk/roundcubemail/SQL/sqlite.initial.sql	2010-03-06 12:43:38 UTC (rev 3332)
+++ trunk/roundcubemail/SQL/sqlite.initial.sql	2010-03-06 14:13:25 UTC (rev 3333)
@@ -56,7 +56,7 @@
   html_signature tinyint NOT NULL default '0'
 );
 
-CREATE INDEX ix_identities_user_id ON identities(user_id);
+CREATE INDEX ix_identities_user_id ON identities(user_id, del);
 
 
 -- --------------------------------------------------------

Modified: trunk/roundcubemail/SQL/sqlite.update.sql
===================================================================
--- trunk/roundcubemail/SQL/sqlite.update.sql	2010-03-06 12:43:38 UTC (rev 3332)
+++ trunk/roundcubemail/SQL/sqlite.update.sql	2010-03-06 14:13:25 UTC (rev 3333)
@@ -22,7 +22,6 @@
 );
 
 CREATE INDEX ix_messages_user_cache_uid ON messages(user_id,cache_key,uid);
-
 CREATE INDEX ix_users_username ON users(username);
 CREATE INDEX ix_users_alias ON users(alias);
 
@@ -43,3 +42,8 @@
 CREATE INDEX ix_messages_index ON messages (user_id,cache_key,idx);
 DROP INDEX ix_contacts_user_id;
 CREATE INDEX ix_contacts_user_id ON contacts(user_id, email);
+
+-- Updates from version 0.3.1
+
+DROP INDEX ix_identities_user_id;
+CREATE INDEX ix_identities_user_id ON identities (user_id, del);

_______________________________________________
http://lists.roundcube.net/mailman/listinfo/svn



More information about the Svn mailing list