]> git.donarmstrong.com Git - roundcube.git/commitdiff
Imported Debian patch 0.5-1
authorVincent Bernat <bernat@debian.org>
Sat, 15 Jan 2011 11:40:27 +0000 (12:40 +0100)
committerJérémy Bobbio <lunar@debian.org>
Sat, 18 Jun 2011 19:23:12 +0000 (21:23 +0200)
16 files changed:
debian/changelog
debian/control
debian/control.in [deleted file]
debian/patches/correct-magic-path.patch
debian/patches/correct_install_path.patch
debian/patches/dbconfig-common_support.patch
debian/patches/default-charset-utf8.patch
debian/patches/loginbox-size.patch
debian/patches/series
debian/patches/use_packaged_tinymce.patch
debian/patches/use_pspell.patch
debian/roundcube-core.postinst
debian/rules
debian/sql/mysql/0.5-1 [new file with mode: 0644]
debian/sql/pgsql/0.5-1 [new file with mode: 0644]
debian/sql/sqlite/0.5-1 [new file with mode: 0644]

index a82c6a1b8c427a25d6d20f6fcd7f5c86291af266..9c9db1b1dc961f503d9cf7d78b93854d39876167 100644 (file)
@@ -1,3 +1,30 @@
+roundcube (0.5-1) experimental; urgency=low
+
+  * New upstream release. Closes: #592312.
+     + Drop patches included upstream (DNS prefetching, jQuery 1.4
+       handling, email address validation, duplicate headers, incorrectly
+       formatted received headers). Adapt other patches. One of the patch
+       now correctly states to use dpkg-reconfigure roundcube-core.
+       Closes: #608977.
+     + Update SQL commands to use to upgrade database.
+       That also closes: #602922. Unfortunately, the user may get some
+       harmless error messages because there is no way to know if
+       0.3.1 was installed from scratch or upgraded from 0.3.
+     + Update dependencies to match INSTALL file. Only exception is the
+       use of Mail_Mime 1.8.0 in place of 1.8.1 which is not available in
+       Debian. We depends on jQuery 1.4.2 because 1.4.4 is not available in
+       Debian.
+     + All folders are correctly checked since 0.4. Closes: #552430.
+     + Also, closes: #553194 since it seems to have been fixed too.
+     + There is also the possibility to not top-quote since 0.4.
+       Closes: #491063.
+     + Closes: #602144. Also fixed.
+  * Move .htaccess to /etc/roundcube and use a symlink (Closes: #591369).
+  * Don't let www-data overwrite debian-db.php. Closes: #608976.
+  * Bump Standards-Version. No changes required.
+
+ -- Vincent Bernat <bernat@debian.org>  Sat, 15 Jan 2011 12:40:27 +0100
+
 roundcube (0.3.1-6) unstable; urgency=low
 
   * Update Arabic debconf translation, thanks to Ossama Khayat.
index e7d42516308323a522e5bafa785da23d13ded5f7..19ebae7fd29e3a3e961a975457dbc45b9ad4fab8 100644 (file)
@@ -3,16 +3,24 @@ Section: web
 Priority: extra
 Maintainer: Debian Roundcube Maintainers <pkg-roundcube-maintainers@lists.alioth.debian.org>
 Uploaders: Vincent Bernat <bernat@debian.org>, Romain Beauxis <toots@rastageeks.org>
-Build-Depends: cdbs, debhelper (>= 5), cdbs (>= 0.4.27), po-debconf
+Build-Depends: cdbs, debhelper (>= 5), dh-buildinfo, po-debconf
 Homepage: http://www.roundcube.net/
-Standards-Version: 3.9.0
+Standards-Version: 3.9.1
 Vcs-Svn: svn://svn.debian.org/svn/pkg-roundcube/trunk
 Vcs-Browser: http://svn.debian.org/wsvn/pkg-roundcube/trunk/
 
 Package: roundcube-core
 Architecture: all
-Depends: dbconfig-common, debconf | debconf-2.0, apache2 | lighttpd | httpd, php5, php5-mcrypt, php5-gd, roundcube-sqlite (= ${source:Version}) | roundcube-mysql (= ${source:Version}) | roundcube-pgsql (= ${source:Version}), php-mdb2, php-auth, php-net-smtp, php-net-socket, php-mail-mime (>= 1.7.0), ucf, tinymce (>= 3), ${misc:Depends}, libmagic1, php5-pspell, libjs-jquery (>= 1.3.3)
-Suggests: php-auth-sasl
+Depends: dbconfig-common, debconf | debconf-2.0, ucf,
+ apache2 | lighttpd | httpd,
+ php5, php5-mcrypt, php5-gd, php5-intl,
+ php-mdb2 (>= 2.5.0), php-auth, php-net-smtp (>= 1.4.2),
+ php-net-socket, php-mail-mime (>= 1.8.0), php5-pspell,
+ tinymce (>= 3), libjs-jquery (>= 1.4.2),
+ libmagic1,
+ roundcube-sqlite (= ${source:Version}) | roundcube-mysql (= ${source:Version}) | roundcube-pgsql (= ${source:Version}),
+ ${misc:Depends}
+Suggests: php-auth-sasl (>= 1.0.3)
 Replaces: roundcube
 Breaks: roundcube (<< 0.1~rc2-2)
 Description: skinnable AJAX based webmail solution for IMAP servers
diff --git a/debian/control.in b/debian/control.in
deleted file mode 100644 (file)
index badc5d5..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-Source: roundcube
-Section: web
-Priority: extra
-Maintainer: Debian Roundcube Maintainers <pkg-roundcube-maintainers@lists.alioth.debian.org>
-Uploaders: Vincent Bernat <bernat@debian.org>, Romain Beauxis <toots@rastageeks.org>
-Build-Depends: @cdbs@, po-debconf
-Homepage: http://www.roundcube.net/
-Standards-Version: 3.9.0
-Vcs-Svn: svn://svn.debian.org/svn/pkg-roundcube/trunk
-Vcs-Browser: http://svn.debian.org/wsvn/pkg-roundcube/trunk/
-
-Package: roundcube-core
-Architecture: all
-Depends: dbconfig-common, debconf | debconf-2.0, apache2 | lighttpd | httpd, php5, php5-mcrypt, php5-gd, roundcube-sqlite (= ${source:Version}) | roundcube-mysql (= ${source:Version}) | roundcube-pgsql (= ${source:Version}), php-mdb2, php-auth, php-net-smtp, php-net-socket, php-mail-mime (>= 1.7.0), ucf, tinymce (>= 3), ${misc:Depends}, libmagic1, php5-pspell, libjs-jquery (>= 1.3.3)
-Suggests: php-auth-sasl
-Replaces: roundcube
-Breaks: roundcube (<< 0.1~rc2-2)
-Description: skinnable AJAX based webmail solution for IMAP servers
- RoundCube Webmail is a browser-based multilingual IMAP client with an
- application-like user interface. It provides full functionality
- expected from an e-mail client, including MIME support, address book,
- folder manipulation and message filters.
- .
- The user interface is fully skinnable using XHTML and CSS 2.
- .
- This package provides the core code for roundcube. You should install
- it along with one of the roundcube database metapackages.
-
-Package: roundcube
-Architecture: all
-Depends: roundcube-core (= ${source:Version}), ${misc:Depends}
-Description: skinnable AJAX based webmail solution for IMAP servers - metapackage
- RoundCube Webmail is a browser-based multilingual IMAP client with an
- application-like user interface. It provides full functionality
- expected from an e-mail client, including MIME support, address book,
- folder manipulation and message filters.
- .
- The user interface is fully skinnable using XHTML and CSS 2.
- .
- This package will install a full roundcube application.
-
-Package: roundcube-mysql
-Architecture: all
-Depends: php-mdb2-driver-mysql (>= 1.5.0b2), mysql-client | virtual-mysql-client, ${misc:Depends}
-Suggests: mysql-server
-Description: metapackage providing MySQL dependencies for RoundCube
- This package provides MySQL dependencies for RoundCube Webmail, a
- skinnable AJAX based webmail solution for IMAP servers. Install this
- one if you want to use a MySQL database with RoundCube.
-
-Package: roundcube-pgsql
-Architecture: all
-Depends: php-mdb2-driver-pgsql (>= 1.5.0b2), postgresql-client-8.1 | postgresql-client, ${misc:Depends}
-Suggests: postgresql-server
-Description: metapackage providing PostgreSQL dependencies for RoundCube
- This package provides PostgreSQL dependencies for RoundCube Webmail,
- a skinnable AJAX based webmail solution for IMAP servers. Install
- this one if you want to use a PostgreSQL database with RoundCube.
-
-Package: roundcube-sqlite
-Architecture: all
-Depends: php-mdb2-driver-sqlite (>= 1.5.0b2), sqlite, ${misc:Depends}
-Description: metapackage providing sqlite dependencies for RoundCube
- This package provides sqlite dependencies for RoundCube Webmail, a
- skinnable AJAX based webmail solution for IMAP servers. Install this
- one if you want to use a sqlite database with RoundCube.
index e2ca99fa8e487826ab1a94c92956a8fad8504033..db7e4bef83a59753680de413c1e93e1d0c7f28f0 100644 (file)
@@ -4,12 +4,12 @@ Index: b/config/main.inc.php.dist
 ===================================================================
 --- a/config/main.inc.php.dist 2009-10-21 10:47:40.000000000 +0200
 +++ b/config/main.inc.php.dist 2010-07-17 17:33:23.000000000 +0200
-@@ -338,7 +338,7 @@
- $rcmail_config['max_pagesize'] = 200;
+@@ -301,7 +301,7 @@
+ $rcmail_config['identities_level'] = 0;
  
  // mime magic database
 -$rcmail_config['mime_magic'] = '/usr/share/misc/magic';
 +$rcmail_config['mime_magic'] = '/usr/share/file/magic';
  
- // default sort col
- $rcmail_config['message_sort_col'] = 'date';
+ // Enable DNS checking for e-mail address validation
+ $rcmail_config['email_dns_check'] = false;
index 04ec738a1c854a90511b0e9d39611721e8bb9750..6afa0984acb4ff25003c34682d8d1895e336be37 100644 (file)
@@ -4,12 +4,12 @@ Index: b/program/include/iniset.php
 ===================================================================
 --- a/program/include/iniset.php       2010-07-17 17:33:04.000000000 +0200
 +++ b/program/include/iniset.php       2010-07-17 17:33:23.000000000 +0200
-@@ -27,7 +27,7 @@
- define('JS_OBJECT_NAME', 'rcmail');
+@@ -42,7 +42,7 @@
+ define('RCMAIL_START', microtime(true));
  
  if (!defined('INSTALL_PATH')) {
--  define('INSTALL_PATH', dirname($_SERVER['SCRIPT_FILENAME']).'/');
-+  define('INSTALL_PATH', '/var/lib/roundcube/');
+-    define('INSTALL_PATH', dirname($_SERVER['SCRIPT_FILENAME']).'/');
++    define('INSTALL_PATH', '/var/lib/roundcube/');
  }
- define('RCMAIL_CONFIG_DIR', INSTALL_PATH . 'config');
+
+ if (!defined('RCMAIL_CONFIG_DIR')) {
index fbc2c0e0589e2a9db3b834f00551050d98268c60..574c67ec084341e303a22fa4a17a8662c2d3b30c 100644 (file)
@@ -11,8 +11,8 @@ Index: b/config/db.inc.php.dist
 -// PEAR database DSN for read/write operations
 -// format is db_provider://user:password@host/database 
 -// For examples see http://pear.php.net/manual/en/package.database.mdb2.intro-dsn.php
--// currently supported db_providers: mysql, mysqli, pgsql, sqlite, mssql
-+/* Do not set db_dsnw here, use dpkg-reconfigure roundcube to configure database ! */
+-// currently supported db_providers: mysql, mysqli, pgsql, sqlite, mssql or sqlsrv
++/* Do not set db_dsnw here, use dpkg-reconfigure roundcube-core to configure database ! */
  
 -$rcmail_config['db_dsnw'] = 'mysql://roundcube:pass@localhost/roundcubemail';
 -// postgres example: 'pgsql://roundcube:pass@localhost/roundcubemail';
index 24c3ea5a244a208badd732bd2f605d76d5db9b50..8e840b20c27978b66299c889c242760a61de1366 100644 (file)
@@ -4,12 +4,12 @@ Index: b/config/main.inc.php.dist
 ===================================================================
 --- a/config/main.inc.php.dist 2010-07-17 17:33:24.000000000 +0200
 +++ b/config/main.inc.php.dist 2010-07-17 17:33:25.000000000 +0200
-@@ -215,7 +215,7 @@
- $rcmail_config['mdn_requests'] = 0;
+@@ -489,7 +489,7 @@
+ // ----------------------------------
  
  // Use this charset as fallback for message decoding
 -$rcmail_config['default_charset'] = 'ISO-8859-1';
 +$rcmail_config['default_charset'] = 'UTF-8';
  
- // Make use of the built-in spell checker. It is based on GoogieSpell.
- // Since Google only accepts connections over https your PHP installatation
+ // skin name: folder from skins/
+ $rcmail_config['skin'] = 'default';
index ce56b9f1d9f89ca36d76eced5d9581ccee72c3db..74c693fc4ed6048f2f6c97c0ae29d51e504db02a 100644 (file)
@@ -4,7 +4,7 @@ Index: b/skins/default/common.css
 ===================================================================
 --- a/skins/default/common.css 2009-10-06 12:00:33.000000000 +0200
 +++ b/skins/default/common.css 2010-07-17 17:33:24.000000000 +0200
-@@ -506,7 +506,7 @@
+@@ -677,7 +677,7 @@
    margin-left: auto;
    margin-right: auto;
    margin-top: 50px;
index 8d2af0057cc0c69853e6682869811533eeacd2ec..bf6a1fece6945960fb8be1f6664e9be6ca31bc3f 100644 (file)
@@ -4,10 +4,4 @@ use_packaged_tinymce.patch
 correct-magic-path.patch
 use_pspell.patch
 loginbox-size.patch
-changeset_r3170.patch
-changeset_r3202.patch
-dont-limit-email-local-part.patch
-disable-dns-prefetch.patch
 default-charset-utf8.patch
-received-headers-sa.patch
-fix-599586.patch
index a498c599608b568ccaf0bf5f296aad89da98a285..438267306797d0fd724beb73bdc5c0559634377c 100644 (file)
@@ -4,7 +4,7 @@ Index: b/program/steps/mail/sendmail.inc
 ===================================================================
 --- a/program/steps/mail/sendmail.inc  2009-10-14 12:52:27.000000000 +0200
 +++ b/program/steps/mail/sendmail.inc  2010-07-17 17:33:23.000000000 +0200
-@@ -128,7 +128,7 @@
+@@ -115,7 +115,7 @@
  
          // sanitize image name so resulting attachment doesn't leave images dir
          $image_name = preg_replace('/[^a-zA-Z0-9_\.\-]/i', '', $image_name);
index d3ade031ee4ce024aba4f7d797f614214976d216..d50c423546a63b3d8208f3fb097e95ea84940610 100644 (file)
@@ -4,7 +4,7 @@ Index: b/config/main.inc.php.dist
 ===================================================================
 --- a/config/main.inc.php.dist 2010-07-17 17:33:23.000000000 +0200
 +++ b/config/main.inc.php.dist 2010-07-17 17:33:24.000000000 +0200
-@@ -224,7 +224,7 @@
+@@ -376,7 +376,7 @@
  
  // Set the spell checking engine. 'googie' is the default. 'pspell' is also available,
  // but requires the Pspell extensions. When using Nox Spell Server, also set 'googie' here.
index 07e961f70b6b4409b6cbfef8880eb6c739ea08ca..cb7e507b465c9b46241751f4802f390f360e8994 100644 (file)
@@ -9,7 +9,7 @@ set -e
 . /usr/share/dbconfig-common/dpkg/postinst 
 dbc_generate_include=php:/etc/roundcube/debian-db.php
 dbc_generate_include_owner="www-data:www-data"
-dbc_generate_include_perms="660"
+dbc_generate_include_perms="640"
 dbc_dbfile_owner="www-data:www-data"
 dbc_dbfile_perms="0660"
 dbc_dbuser=roundcube
index 92d44a21ef4f992225bfbe47e0847fe989064256..e7322f5d708077c22450870791aa8f8b3474c539 100755 (executable)
@@ -4,10 +4,6 @@ include /usr/share/cdbs/1/rules/debhelper.mk
 
 DEB_INSTALL_CHANGELOGS_ALL=CHANGELOG
 
-# In order to regenerate 'debian/control' :
-#    DEB_AUTO_UPDATE_DEBIAN_CONTROL=yes fakeroot debian/rules clean
-# Then check manually if everything's ok
-
 binary-install/roundcube-core::
        # Remove plugins
        rm -rf $(CURDIR)/debian/roundcube-core/usr/share/roundcube/plugins
@@ -23,9 +19,11 @@ binary-install/roundcube-core::
        # Install config files
        install -m 0640 $(CURDIR)/config/db.inc.php.dist $(CURDIR)/debian/roundcube-core/etc/roundcube/db.inc.php
        install -m 0640 $(CURDIR)/config/main.inc.php.dist $(CURDIR)/debian/roundcube-core/usr/share/roundcube
+       install -m 0640 $(CURDIR)/.htaccess $(CURDIR)/debian/roundcube-core/etc/roundcube/htaccess
        for c in $(CURDIR)/debian/roundcube-core/etc/roundcube/*.php; do \
                dh_link -proundcube-core etc/roundcube/$$(basename $$c) var/lib/roundcube/config/$$(basename $$c) ; \
        done
+       dh_link -proundcube-core etc/roundcube/htaccess var/lib/roundcube/.htaccess
 
        # Database related files
        # Install empty tables and updates for each db type
@@ -39,16 +37,15 @@ binary-install/roundcube-core::
        # Some files are executable while not being scripts or binary...
        find $(CURDIR)/debian/roundcube-core/usr/share/roundcube -type f -print0 | xargs -r0 chmod -x
        # Remove useless file
-       rm $(CURDIR)/debian/roundcube-core/usr/share/roundcube/bin/*.sh
-       rm $(CURDIR)/debian/roundcube-core/usr/share/roundcube/bin/decrypt.php
+       rm -rf $(CURDIR)/debian/roundcube-core/usr/share/roundcube/bin
        find $(CURDIR)/debian/roundcube-core -name '._*' -print0 | xargs -r0 rm
        find $(CURDIR)/debian/roundcube-core -name '*.js.src' -print0 | xargs -r0 rm
        # Remove files shipped in tinymce package
        rm -rf $(CURDIR)/debian/roundcube-core/usr/share/roundcube/program/js/tiny_mce
        dh_link -proundcube-core usr/share/tinymce/www usr/share/roundcube/program/js/tiny_mce
        # Remove jquery as well
-       rm $(CURDIR)/debian/roundcube-core/usr/share/roundcube/program/js/jquery-1.3.min.js
-       dh_link -proundcube-core usr/share/javascript/jquery/jquery.min.js usr/share/roundcube/program/js/jquery-1.3.min.js
+       rm $(CURDIR)/debian/roundcube-core/usr/share/roundcube/program/js/jquery-1.4.min.js
+       dh_link -proundcube-core usr/share/javascript/jquery/jquery.min.js usr/share/roundcube/program/js/jquery-1.4.min.js
 
 $(patsubst %,binary-install/%,$(DEB_PACKAGES)) :: binary-install/% :
        install -d $(CURDIR)/debian/$(cdbs_curpkg)/usr/share/bug/$(cdbs_curpkg)
diff --git a/debian/sql/mysql/0.5-1 b/debian/sql/mysql/0.5-1
new file mode 100644 (file)
index 0000000..9d7f758
--- /dev/null
@@ -0,0 +1,87 @@
+-- Ensure we are using InnoDB as engine.
+
+ALTER TABLE `cache` ENGINE=InnoDB;
+ALTER TABLE `session` ENGINE=InnoDB;
+ALTER TABLE `messages` ENGINE=InnoDB;
+ALTER TABLE `users` ENGINE=InnoDB;
+ALTER TABLE `contacts` ENGINE=InnoDB;
+ALTER TABLE `identities` ENGINE=InnoDB;
+
+-- Updates from version 0.3-stable
+
+TRUNCATE `messages`;
+
+ALTER TABLE `messages`
+    ADD INDEX `index_index` (`user_id`, `cache_key`, `idx`);
+
+ALTER TABLE `session` 
+    CHANGE `vars` `vars` MEDIUMTEXT NOT NULL;
+
+ALTER TABLE `contacts`
+    ADD INDEX `user_contacts_index` (`user_id`,`email`);
+
+-- Updates from version 0.3.1
+-- WARNING: Make sure that all tables are using InnoDB engine!!!
+--          If not, use: ALTER TABLE xxx ENGINE=InnoDB;
+
+/* MySQL bug workaround: http://bugs.mysql.com/bug.php?id=46293 */
+/*!40014 SET FOREIGN_KEY_CHECKS=0 */;
+
+ALTER TABLE `messages` DROP FOREIGN KEY `user_id_fk_messages`;
+ALTER TABLE `cache` DROP FOREIGN KEY `user_id_fk_cache`;
+ALTER TABLE `contacts` DROP FOREIGN KEY `user_id_fk_contacts`;
+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`) ON DELETE CASCADE ON UPDATE CASCADE;
+ALTER TABLE `cache` ADD CONSTRAINT `user_id_fk_cache` FOREIGN KEY (`user_id`)
+ REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE;
+ALTER TABLE `contacts` ADD CONSTRAINT `user_id_fk_contacts` FOREIGN KEY (`user_id`)
+ REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE;
+ALTER TABLE `identities` ADD CONSTRAINT `user_id_fk_identities` FOREIGN KEY (`user_id`)
+ REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE;
+
+ALTER TABLE `contacts` ALTER `name` SET DEFAULT '';
+ALTER TABLE `contacts` ALTER `firstname` SET DEFAULT '';
+ALTER TABLE `contacts` ALTER `surname` SET DEFAULT '';
+
+ALTER TABLE `identities` ADD INDEX `user_identities_index` (`user_id`, `del`);
+ALTER TABLE `identities` ADD `changed` datetime NOT NULL DEFAULT '1000-01-01 00:00:00' AFTER `user_id`;
+
+CREATE TABLE `contactgroups` (
+  `contactgroup_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
+  `user_id` int(10) UNSIGNED NOT NULL DEFAULT '0',
+  `changed` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
+  `del` tinyint(1) NOT NULL DEFAULT '0',
+  `name` varchar(128) NOT NULL DEFAULT '',
+  PRIMARY KEY(`contactgroup_id`),
+  CONSTRAINT `user_id_fk_contactgroups` FOREIGN KEY (`user_id`)
+    REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
+  INDEX `contactgroups_user_index` (`user_id`,`del`)
+) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
+
+CREATE TABLE `contactgroupmembers` (
+  `contactgroup_id` int(10) UNSIGNED NOT NULL,
+  `contact_id` int(10) UNSIGNED NOT NULL DEFAULT '0',
+  `created` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
+  PRIMARY KEY (`contactgroup_id`, `contact_id`),
+  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
+) /*!40000 ENGINE=INNODB */;
+
+/*!40014 SET FOREIGN_KEY_CHECKS=1 */;
+
+-- Updates from version 0.4-beta
+
+ALTER TABLE `users` CHANGE `last_login` `last_login` datetime DEFAULT NULL;
+UPDATE `users` SET `last_login` = NULL WHERE `last_login` = '1000-01-01 00:00:00';
+
+-- Updates from version 0.4.2
+
+ALTER TABLE `users` DROP INDEX `username_index`;
+ALTER TABLE `users` ADD UNIQUE `username` (`username`, `mail_host`);
+
+ALTER TABLE `contacts` MODIFY `email` varchar(255) NOT NULL;
+
diff --git a/debian/sql/pgsql/0.5-1 b/debian/sql/pgsql/0.5-1
new file mode 100644 (file)
index 0000000..73e50be
--- /dev/null
@@ -0,0 +1,51 @@
+-- Updates from version 0.3-stable
+
+TRUNCATE messages;
+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);
+
+ALTER TABLE identities ADD changed timestamp with time zone DEFAULT now() NOT NULL;
+
+CREATE SEQUENCE contactgroups_ids
+    INCREMENT BY 1
+    NO MAXVALUE
+    NO MINVALUE
+    CACHE 1;
+
+CREATE TABLE contactgroups (
+    contactgroup_id integer DEFAULT nextval('contactgroups_ids'::text) PRIMARY KEY,
+    user_id    integer         NOT NULL
+        REFERENCES users(user_id) ON DELETE CASCADE ON UPDATE CASCADE,
+    changed    timestamp with time zone DEFAULT now() NOT NULL,
+    del        smallint        NOT NULL DEFAULT 0,
+    name       varchar(128)    NOT NULL DEFAULT ''
+);
+
+CREATE INDEX contactgroups_user_id_idx ON contactgroups (user_id, del);
+
+CREATE TABLE contactgroupmembers (
+    contactgroup_id    integer NOT NULL
+       REFERENCES contactgroups(contactgroup_id) ON DELETE CASCADE ON UPDATE CASCADE,
+    contact_id                 integer NOT NULL
+       REFERENCES contacts(contact_id) ON DELETE CASCADE ON UPDATE CASCADE,
+    created timestamp with time zone DEFAULT now() NOT NULL,
+    PRIMARY KEY (contactgroup_id, contact_id)
+);
+
+-- Updates from version 0.4-beta
+
+ALTER TABLE users ALTER last_login DROP NOT NULL;
+ALTER TABLE users ALTER last_login SET DEFAULT NULL;
+
+-- Updates from version 0.4.2
+
+DROP INDEX users_username_id_idx;
+ALTER TABLE users ADD UNIQUE (username, mail_host);
+ALTER TABLE contacts ALTER email TYPE varchar(255);
+
diff --git a/debian/sql/sqlite/0.5-1 b/debian/sql/sqlite/0.5-1
new file mode 100644 (file)
index 0000000..d3aad40
--- /dev/null
@@ -0,0 +1,146 @@
+-- Updates from version 0.3-stable
+
+DELETE FROM messages;
+DROP INDEX ix_messages_user_cache_uid;
+CREATE UNIQUE INDEX ix_messages_user_cache_uid ON messages (user_id,cache_key,uid);
+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
+
+-- ALTER TABLE identities ADD COLUMN changed datetime NOT NULL default '0000-00-00 00:00:00'; --
+
+CREATE TABLE temp_identities (
+  identity_id integer NOT NULL PRIMARY KEY,
+  user_id integer NOT NULL default '0',
+  standard tinyint NOT NULL default '0',
+  name varchar(128) NOT NULL default '',
+  organization varchar(128) default '',
+  email varchar(128) NOT NULL default '',
+  "reply-to" varchar(128) NOT NULL default '',
+  bcc varchar(128) NOT NULL default '',
+  signature text NOT NULL default '',
+  html_signature tinyint NOT NULL default '0'
+);
+INSERT INTO temp_identities (identity_id, user_id, standard, name, organization, email, "reply-to", bcc, signature, html_signature)
+  SELECT identity_id, user_id, standard, name, organization, email, "reply-to", bcc, signature, html_signature
+  FROM identities WHERE del=0;
+
+DROP INDEX ix_identities_user_id;
+DROP TABLE identities;
+
+CREATE TABLE identities (
+  identity_id integer NOT NULL PRIMARY KEY,
+  user_id integer NOT NULL default '0',
+  changed datetime NOT NULL default '0000-00-00 00:00:00',
+  del tinyint NOT NULL default '0',
+  standard tinyint NOT NULL default '0',
+  name varchar(128) NOT NULL default '',
+  organization varchar(128) default '',
+  email varchar(128) NOT NULL default '',
+  "reply-to" varchar(128) NOT NULL default '',
+  bcc varchar(128) NOT NULL default '',
+  signature text NOT NULL default '',
+  html_signature tinyint NOT NULL default '0'
+);
+CREATE INDEX ix_identities_user_id ON identities(user_id, del);
+
+INSERT INTO identities (identity_id, user_id, standard, name, organization, email, "reply-to", bcc, signature, html_signature)
+  SELECT identity_id, user_id, standard, name, organization, email, "reply-to", bcc, signature, html_signature
+  FROM temp_identities;
+
+DROP TABLE temp_identities;
+
+CREATE TABLE contactgroups (
+  contactgroup_id integer NOT NULL PRIMARY KEY,
+  user_id integer NOT NULL default '0',
+  changed datetime NOT NULL default '0000-00-00 00:00:00',
+  del tinyint NOT NULL default '0',
+  name varchar(128) NOT NULL default ''
+);
+
+CREATE INDEX ix_contactgroups_user_id ON contactgroups(user_id, del);
+
+CREATE TABLE contactgroupmembers (
+  contactgroup_id integer NOT NULL,
+  contact_id integer NOT NULL default '0',
+  created datetime NOT NULL default '0000-00-00 00:00:00',
+  PRIMARY KEY (contactgroup_id, contact_id)
+);
+
+-- Updates from version 0.3.1
+
+CREATE TABLE tmp_users (
+  user_id integer NOT NULL PRIMARY KEY,
+  username varchar(128) NOT NULL default '',
+  mail_host varchar(128) NOT NULL default '',
+  alias varchar(128) NOT NULL default '',
+  created datetime NOT NULL default '0000-00-00 00:00:00',
+  last_login datetime NOT NULL default '0000-00-00 00:00:00',
+  language varchar(5),
+  preferences text NOT NULL default ''
+);
+
+INSERT INTO tmp_users (user_id, username, mail_host, alias, created, last_login, language, preferences)
+    SELECT user_id, username, mail_host, alias, created, last_login, language, preferences FROM users;
+
+DROP TABLE users;
+
+CREATE TABLE users (
+  user_id integer NOT NULL PRIMARY KEY,
+  username varchar(128) NOT NULL default '',
+  mail_host varchar(128) NOT NULL default '',
+  alias varchar(128) NOT NULL default '',
+  created datetime NOT NULL default '0000-00-00 00:00:00',
+  last_login datetime DEFAULT NULL,
+  language varchar(5),
+  preferences text NOT NULL default ''
+);
+
+INSERT INTO users (user_id, username, mail_host, alias, created, last_login, language, preferences)
+    SELECT user_id, username, mail_host, alias, created, last_login, language, preferences FROM tmp_users;
+
+CREATE INDEX ix_users_username ON users(username);
+CREATE INDEX ix_users_alias ON users(alias);
+DROP TABLE tmp_users;
+
+-- Updates from version 0.4.2
+
+DROP INDEX ix_users_username;
+CREATE UNIQUE INDEX ix_users_username ON users(username, mail_host);
+
+CREATE TABLE contacts_tmp (
+    contact_id integer NOT NULL PRIMARY KEY,
+    user_id integer NOT NULL default '0',
+    changed datetime NOT NULL default '0000-00-00 00:00:00',
+    del tinyint NOT NULL default '0',
+    name varchar(128) NOT NULL default '',
+    email varchar(255) NOT NULL default '',
+    firstname varchar(128) NOT NULL default '',
+    surname varchar(128) NOT NULL default '',
+    vcard text NOT NULL default ''
+);
+
+INSERT INTO contacts_tmp (contact_id, user_id, changed, del, name, email, firstname, surname, vcard)
+    SELECT contact_id, user_id, changed, del, name, email, firstname, surname, vcard FROM contacts;
+
+DROP TABLE contacts;
+CREATE TABLE contacts (
+    contact_id integer NOT NULL PRIMARY KEY,
+    user_id integer NOT NULL default '0',
+    changed datetime NOT NULL default '0000-00-00 00:00:00',
+    del tinyint NOT NULL default '0',
+    name varchar(128) NOT NULL default '',
+    email varchar(255) NOT NULL default '',
+    firstname varchar(128) NOT NULL default '',
+    surname varchar(128) NOT NULL default '',
+    vcard text NOT NULL default ''
+);
+
+INSERT INTO contacts (contact_id, user_id, changed, del, name, email, firstname, surname, vcard)
+    SELECT contact_id, user_id, changed, del, name, email, firstname, surname, vcard FROM contacts_tmp;
+
+CREATE INDEX ix_contacts_user_id ON contacts(user_id, email);
+DROP TABLE contacts_tmp;
+