"Fossies" - the Fresh Open Source Software Archive

Member "roundcubemail-1.4.2/SQL/mysql/2009103100.sql" (1 Jan 2020, 2685 Bytes) of package /linux/www/roundcubemail-1.4.2.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) PL/SQL source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 -- Updates from version 0.3.1
    2 -- WARNING: Make sure that all tables are using InnoDB engine!!!
    3 --          If not, use: ALTER TABLE xxx ENGINE=InnoDB;
    4 
    5 /* MySQL bug workaround: http://bugs.mysql.com/bug.php?id=46293 */
    6 /*!40014 SET FOREIGN_KEY_CHECKS=0 */;
    7 
    8 ALTER TABLE `messages` DROP FOREIGN KEY `user_id_fk_messages`;
    9 ALTER TABLE `cache` DROP FOREIGN KEY `user_id_fk_cache`;
   10 ALTER TABLE `contacts` DROP FOREIGN KEY `user_id_fk_contacts`;
   11 ALTER TABLE `identities` DROP FOREIGN KEY `user_id_fk_identities`;
   12 
   13 ALTER TABLE `messages` ADD CONSTRAINT `user_id_fk_messages` FOREIGN KEY (`user_id`)
   14  REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE;
   15 ALTER TABLE `cache` ADD CONSTRAINT `user_id_fk_cache` FOREIGN KEY (`user_id`)
   16  REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE;
   17 ALTER TABLE `contacts` ADD CONSTRAINT `user_id_fk_contacts` FOREIGN KEY (`user_id`)
   18  REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE;
   19 ALTER TABLE `identities` ADD CONSTRAINT `user_id_fk_identities` FOREIGN KEY (`user_id`)
   20  REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE;
   21 
   22 ALTER TABLE `contacts` ALTER `name` SET DEFAULT '';
   23 ALTER TABLE `contacts` ALTER `firstname` SET DEFAULT '';
   24 ALTER TABLE `contacts` ALTER `surname` SET DEFAULT '';
   25 
   26 ALTER TABLE `identities` ADD INDEX `user_identities_index` (`user_id`, `del`);
   27 ALTER TABLE `identities` ADD `changed` datetime NOT NULL DEFAULT '1000-01-01 00:00:00' AFTER `user_id`;
   28 
   29 CREATE TABLE `contactgroups` (
   30   `contactgroup_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
   31   `user_id` int(10) UNSIGNED NOT NULL DEFAULT '0',
   32   `changed` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
   33   `del` tinyint(1) NOT NULL DEFAULT '0',
   34   `name` varchar(128) NOT NULL DEFAULT '',
   35   PRIMARY KEY(`contactgroup_id`),
   36   CONSTRAINT `user_id_fk_contactgroups` FOREIGN KEY (`user_id`)
   37     REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
   38   INDEX `contactgroups_user_index` (`user_id`,`del`)
   39 ) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
   40 
   41 CREATE TABLE `contactgroupmembers` (
   42   `contactgroup_id` int(10) UNSIGNED NOT NULL,
   43   `contact_id` int(10) UNSIGNED NOT NULL DEFAULT '0',
   44   `created` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
   45   PRIMARY KEY (`contactgroup_id`, `contact_id`),
   46   CONSTRAINT `contactgroup_id_fk_contactgroups` FOREIGN KEY (`contactgroup_id`)
   47     REFERENCES `contactgroups`(`contactgroup_id`) ON DELETE CASCADE ON UPDATE CASCADE,
   48   CONSTRAINT `contact_id_fk_contacts` FOREIGN KEY (`contact_id`)
   49     REFERENCES `contacts`(`contact_id`) ON DELETE CASCADE ON UPDATE CASCADE
   50 ) /*!40000 ENGINE=INNODB */;
   51 
   52 /*!40014 SET FOREIGN_KEY_CHECKS=1 */;