Compare commits
121 Commits
master
...
release-0.
Author | SHA1 | Date |
---|---|---|
Aleksander Machniak | 1972037274 | 11 years ago |
Aleksander Machniak | 6a0eed5066 | 11 years ago |
Thomas Bruederli | 6233a6911f | 11 years ago |
Thomas Bruederli | ce0c1f44a3 | 11 years ago |
Thomas Bruederli | 95ac3e217a | 11 years ago |
Aleksander Machniak | 395b74051c | 11 years ago |
Aleksander Machniak | 268a28efb2 | 12 years ago |
Aleksander Machniak | 377793d67c | 12 years ago |
Thomas Bruederli | a5c8786a34 | 12 years ago |
Thomas Bruederli | f9a25bd418 | 12 years ago |
Aleksander Machniak | b1263ab253 | 12 years ago |
Remi Collet | ccbf0da6eb | 12 years ago |
Aleksander Machniak | b39e8e4174 | 12 years ago |
Aleksander Machniak | 76d3b47145 | 12 years ago |
Aleksander Machniak | 639a825b2e | 12 years ago |
Aleksander Machniak | 9bfaf5f070 | 12 years ago |
Aleksander Machniak | 1ff03fb29d | 12 years ago |
Aleksander Machniak | c2c162c240 | 12 years ago |
Thomas Bruederli | da0c480b9d | 12 years ago |
Thomas Bruederli | d063993a4b | 12 years ago |
Aleksander Machniak | 872d209bcd | 12 years ago |
Thomas Bruederli | bf73e037d6 | 12 years ago |
Aleksander Machniak | 51fcb01f0a | 12 years ago |
Thomas Bruederli | a8e478c07c | 12 years ago |
Thomas Bruederli | 4e6e3b64c0 | 12 years ago |
Aleksander Machniak | d098e205a0 | 12 years ago |
Thomas Bruederli | 2c89ca7298 | 12 years ago |
Aleksander Machniak | e8cab44de0 | 12 years ago |
Aleksander Machniak | 358b0f8bbc | 12 years ago |
Aleksander Machniak | cc57dad1cd | 12 years ago |
Aleksander Machniak | 9899abc36c | 12 years ago |
alecpl | 77799d87ba | 12 years ago |
alecpl | cba69dd977 | 12 years ago |
alecpl | f451a1ca5e | 12 years ago |
alecpl | fe22e87d29 | 12 years ago |
alecpl | a8d90bd175 | 12 years ago |
thomascube | 315993ef0f | 12 years ago |
alecpl | 7190667885 | 12 years ago |
alecpl | ab5036eef7 | 12 years ago |
alecpl | 053538bf60 | 12 years ago |
alecpl | b1a8dabb1f | 12 years ago |
alecpl | b1fa85b7e8 | 12 years ago |
alecpl | 4ffa559227 | 12 years ago |
alecpl | 0411ae5a29 | 12 years ago |
thomascube | 2d3f635a97 | 12 years ago |
thomascube | 249303d441 | 12 years ago |
thomascube | b8e6ba1908 | 12 years ago |
thomascube | 4dc22dd634 | 12 years ago |
thomascube | ba36dd03f6 | 12 years ago |
alecpl | 5ea6e16036 | 12 years ago |
alecpl | 735bf7c3e1 | 12 years ago |
alecpl | 06ca480d1e | 12 years ago |
thomascube | 7fb577bc8f | 13 years ago |
thomascube | ee9ee7f66f | 13 years ago |
alecpl | 82775db0a4 | 13 years ago |
alecpl | 20588763f2 | 13 years ago |
alecpl | 40858c00ef | 13 years ago |
alecpl | 68d3aada14 | 13 years ago |
alecpl | 9ac31a6123 | 13 years ago |
alecpl | 3c36bcc329 | 13 years ago |
alecpl | 63b9ff12d2 | 13 years ago |
alecpl | be431441cb | 13 years ago |
thomascube | 89730fa4e2 | 13 years ago |
thomascube | b115ba77d1 | 13 years ago |
thomascube | 0d114efc93 | 13 years ago |
thomascube | 8dea9b4c16 | 13 years ago |
thomascube | 49cdae95f6 | 13 years ago |
alecpl | fd65421904 | 13 years ago |
alecpl | d69f8f0611 | 13 years ago |
alecpl | a33118fd0f | 13 years ago |
alecpl | 896b2204e8 | 13 years ago |
alecpl | a128fafbe8 | 13 years ago |
alecpl | bc8437b71c | 13 years ago |
alecpl | e81c00b7b9 | 13 years ago |
alecpl | 79c6ac9b92 | 13 years ago |
alecpl | 9fc4eb3f82 | 13 years ago |
alecpl | d355c04084 | 13 years ago |
alecpl | 984ee8ce92 | 13 years ago |
alecpl | 96c946ee6c | 13 years ago |
alecpl | 89dc8499c3 | 13 years ago |
alecpl | e8b2579865 | 13 years ago |
thomascube | faf5fb4c07 | 13 years ago |
thomascube | 62d5be17fd | 13 years ago |
alecpl | e2f30659a1 | 13 years ago |
thomascube | f41565354b | 13 years ago |
thomascube | e02694c3a6 | 13 years ago |
alecpl | 19073428b1 | 13 years ago |
thomascube | 245a0ebb88 | 13 years ago |
alecpl | 4f5257e5eb | 13 years ago |
alecpl | 7fde6ff46a | 13 years ago |
thomascube | 080c74859d | 13 years ago |
alecpl | 3c5099f22b | 13 years ago |
thomascube | 1112978a82 | 13 years ago |
thomascube | fe2773c875 | 13 years ago |
alecpl | db4ec58b90 | 13 years ago |
thomascube | f47d5e2089 | 13 years ago |
alecpl | e237eec846 | 13 years ago |
alecpl | a691021389 | 13 years ago |
alecpl | 6f98b9100b | 13 years ago |
alecpl | 0597586b89 | 13 years ago |
alecpl | 230ccbaef0 | 13 years ago |
alecpl | 77449d011b | 13 years ago |
alecpl | 2a3e02769d | 13 years ago |
alecpl | 3ad2b1b4b0 | 13 years ago |
alecpl | c994e0e7cd | 13 years ago |
thomascube | bdb649067d | 13 years ago |
alecpl | 3fd5e2edfc | 13 years ago |
alecpl | 3fec6952dd | 13 years ago |
alecpl | ecfaed571b | 13 years ago |
thomascube | c82bf6689f | 13 years ago |
thomascube | ad71ba4fcd | 13 years ago |
alecpl | 51f7a5b2a0 | 13 years ago |
thomascube | 69cb80b059 | 13 years ago |
thomascube | 2573a872c4 | 13 years ago |
thomascube | 44a352b7b8 | 13 years ago |
alecpl | f1654a33b2 | 13 years ago |
thomascube | 799e120145 | 13 years ago |
thomascube | 831fde154d | 13 years ago |
thomascube | 5da48a9522 | 13 years ago |
thomascube | b03854de3a | 13 years ago |
thomascube | de1a3f40b1 | 13 years ago |
@ -1,30 +0,0 @@
|
||||
<?php
|
||||
|
||||
$config = array();
|
||||
|
||||
// Database configuration
|
||||
$config['db_dsnw'] = 'sqlite:////tmp/sqlite.db?mode=0646';
|
||||
|
||||
// Test user credentials
|
||||
$config['tests_username'] = 'test';
|
||||
$config['tests_password'] = 'test';
|
||||
|
||||
// GreenMail
|
||||
$config['smtp_port'] = 25;
|
||||
|
||||
// Settings required by the tests
|
||||
|
||||
$config['create_default_folders'] = true;
|
||||
$config['skin'] = 'elastic';
|
||||
$config['support_url'] = 'http://support.url';
|
||||
|
||||
// Plugins with tests
|
||||
|
||||
$config['plugins'] = [
|
||||
'archive',
|
||||
'attachment_reminder',
|
||||
'markasjunk',
|
||||
'zipdownload'
|
||||
];
|
||||
|
||||
$config['archive_mbox'] = 'Archive';
|
@ -1,22 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# The script is intended for use on Travis with Trusty distribution
|
||||
|
||||
DIR=$(dirname $0)
|
||||
|
||||
# Enable xdebug for code coverage
|
||||
if [ "$CODE_COVERAGE" != 1 ]; then phpenv config-rm xdebug.ini || true; fi
|
||||
|
||||
cd $DIR/..
|
||||
|
||||
cp composer.json-dist composer.json
|
||||
|
||||
# Add laravel/dusk for Browser tests
|
||||
if [ "$BROWSER_TESTS" = 1 ]; then composer require "laravel/dusk:~5.9.1" --no-update; fi
|
||||
|
||||
# Remove qr-code as it requires php-gd which is not always available on Travis
|
||||
# and we don't really need it for tests
|
||||
composer remove endroid/qr-code --no-update
|
||||
|
||||
# Install PHP dependencies
|
||||
composer install --prefer-dist
|
@ -1,25 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# The script is intended for use on Travis with Trusty distribution
|
||||
# It executes unit and functional tests
|
||||
|
||||
DIR=$(dirname $0)
|
||||
cd $DIR/..
|
||||
|
||||
if [ "$CODE_COVERAGE" = 1 ]
|
||||
then
|
||||
CODE_COVERAGE_ARGS="--coverage-text"
|
||||
fi
|
||||
|
||||
vendor/bin/phpunit -c tests/phpunit.xml $CODE_COVERAGE_ARGS
|
||||
|
||||
if [ "$BROWSER_TESTS" = 1 ] && [ $? = 0 ]
|
||||
then
|
||||
.ci/setup.sh \
|
||||
&& echo "TESTS_MODE: DESKTOP" \
|
||||
&& TESTS_MODE=desktop vendor/bin/phpunit -c tests/Browser/phpunit.xml \
|
||||
&& echo "TESTS_MODE: PHONE" \
|
||||
&& TESTS_MODE=phone vendor/bin/phpunit -c tests/Browser/phpunit.xml \
|
||||
&& echo "TESTS_MODE: TABLET" \
|
||||
&& TESTS_MODE=tablet vendor/bin/phpunit -c tests/Browser/phpunit.xml
|
||||
fi
|
@ -1,30 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# The script is intended for use on Travis with Trusty distribution
|
||||
# It installs in-browser tests dependencies and prepares Roundcube instance
|
||||
|
||||
GMV=1.5.11
|
||||
CHROMEVERSION=$(google-chrome-stable --version | tr -cd [:digit:]. | cut -d . -f 1)
|
||||
GMARGS="-Dgreenmail.setup.all -Dgreenmail.users=test:test -Dgreenmail.startup.timeout=3000"
|
||||
|
||||
# Roundcube tests and instance configuration
|
||||
cp .ci/config-test.inc.php config/config-test.inc.php
|
||||
|
||||
# Make temp and logs writeable
|
||||
sudo chmod 777 temp logs
|
||||
|
||||
# Install javascript dependencies
|
||||
bin/install-jsdeps.sh
|
||||
|
||||
# Compile Elastic's styles
|
||||
lessc skins/elastic/styles/styles.less > skins/elastic/styles/styles.css
|
||||
lessc skins/elastic/styles/print.less > skins/elastic/styles/print.css
|
||||
lessc skins/elastic/styles/embed.less > skins/elastic/styles/embed.css
|
||||
|
||||
# Install proper WebDriver version for installed Chrome browser
|
||||
php tests/Browser/install.php $CHROMEVERSION
|
||||
|
||||
# GreenMail server download, setup and start
|
||||
wget https://repo1.maven.org/maven2/com/icegreen/greenmail-standalone/$GMV/greenmail-standalone-$GMV.jar \
|
||||
&& (sudo java $GMARGS -jar greenmail-standalone-$GMV.jar &) \
|
||||
&& sleep 5
|
@ -1,23 +0,0 @@
|
||||
# ignore files added to these directories
|
||||
logs/*
|
||||
temp/*
|
||||
config/*
|
||||
plugins/*/config.inc.php
|
||||
|
||||
# this is for the sample plugin (via composer)
|
||||
plugins/rcsample
|
||||
plugins/plugin_manager
|
||||
|
||||
# composer-related
|
||||
composer.json
|
||||
composer.phar
|
||||
composer.lock
|
||||
vendor
|
||||
|
||||
# javascript dependencies
|
||||
plugins/enigma/openpgp.min.js
|
||||
plugins/managesieve/codemirror/
|
||||
program/js/jquery.min.js
|
||||
program/js/jstz.min.js
|
||||
program/js/publickey.js
|
||||
program/js/tinymce/
|
@ -1,37 +0,0 @@
|
||||
language: php
|
||||
|
||||
dist: trusty #
|
||||
sudo: false
|
||||
|
||||
matrix:
|
||||
fast_finish: true
|
||||
include:
|
||||
- php: 5.4
|
||||
- php: 5.5
|
||||
- php: 5.6
|
||||
- php: 7.0
|
||||
- php: 7.1
|
||||
env: CODE_COVERAGE=1
|
||||
- php: 7.2
|
||||
- php: 7.3
|
||||
dist: bionic # for proper node-less version
|
||||
env: BROWSER_TESTS=1
|
||||
addons:
|
||||
chrome: stable
|
||||
apt:
|
||||
packages:
|
||||
- node-less
|
||||
- php: 7.4
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/.composer
|
||||
|
||||
install:
|
||||
- .ci/install.sh
|
||||
|
||||
script:
|
||||
- .ci/run.sh
|
||||
|
||||
notifications:
|
||||
email: false
|
@ -1,99 +0,0 @@
|
||||
[main]
|
||||
host = https://www.transifex.com
|
||||
lang_map = be: be_BE, sr: sr_CS, fa: fa_AF, lb: lb_LU, fr: fr_FR
|
||||
type = PHP_ALT_ARRAY
|
||||
|
||||
[roundcube-webmail.labels]
|
||||
file_filter = program/localization/<lang>/labels.inc
|
||||
source_file = program/localization/en_US/labels.inc
|
||||
source_lang = en_US
|
||||
|
||||
[roundcube-webmail.messages]
|
||||
file_filter = program/localization/<lang>/messages.inc
|
||||
source_file = program/localization/en_US/messages.inc
|
||||
source_lang = en_US
|
||||
|
||||
[roundcube-webmail.timezones]
|
||||
file_filter = program/localization/<lang>/timezones.inc
|
||||
source_file = program/localization/en_US/timezones.inc
|
||||
source_lang = en_US
|
||||
|
||||
[roundcube-webmail.plugin-acl]
|
||||
file_filter = plugins/acl/localization/<lang>.inc
|
||||
source_file = plugins/acl/localization/en_US.inc
|
||||
source_lang = en_US
|
||||
|
||||
[roundcube-webmail.plugin-archive]
|
||||
file_filter = plugins/archive/localization/<lang>.inc
|
||||
source_file = plugins/archive/localization/en_US.inc
|
||||
source_lang = en_US
|
||||
|
||||
[roundcube-webmail.plugin-attachment_reminder]
|
||||
file_filter = plugins/attachment_reminder/localization/<lang>.inc
|
||||
source_file = plugins/attachment_reminder/localization/en_US.inc
|
||||
source_lang = en_US
|
||||
|
||||
[roundcube-webmail.plugin-emoticons]
|
||||
file_filter = plugins/emoticons/localization/<lang>.inc
|
||||
source_file = plugins/emoticons/localization/en_US.inc
|
||||
source_lang = en_US
|
||||
|
||||
[roundcube-webmail.plugin-enigma]
|
||||
file_filter = plugins/enigma/localization/<lang>.inc
|
||||
source_file = plugins/enigma/localization/en_US.inc
|
||||
source_lang = en_US
|
||||
|
||||
[roundcube-webmail.plugin-help]
|
||||
file_filter = plugins/help/localization/<lang>.inc
|
||||
source_file = plugins/help/localization/en_US.inc
|
||||
source_lang = en_US
|
||||
|
||||
[roundcube-webmail.plugin-hide_blockquote]
|
||||
file_filter = plugins/hide_blockquote/localization/<lang>.inc
|
||||
source_file = plugins/hide_blockquote/localization/en_US.inc
|
||||
source_lang = en_US
|
||||
|
||||
[roundcube-webmail.plugin-managesieve]
|
||||
file_filter = plugins/managesieve/localization/<lang>.inc
|
||||
source_file = plugins/managesieve/localization/en_US.inc
|
||||
source_lang = en_US
|
||||
|
||||
[roundcube-webmail.plugin-markasjunk]
|
||||
file_filter = plugins/markasjunk/localization/<lang>.inc
|
||||
source_file = plugins/markasjunk/localization/en_US.inc
|
||||
source_lang = en_US
|
||||
|
||||
[roundcube-webmail.plugin-new_user_dialog]
|
||||
file_filter = plugins/new_user_dialog/localization/<lang>.inc
|
||||
source_file = plugins/new_user_dialog/localization/en_US.inc
|
||||
source_lang = en_US
|
||||
|
||||
[roundcube-webmail.plugin-newmail_notifier]
|
||||
file_filter = plugins/newmail_notifier/localization/<lang>.inc
|
||||
source_file = plugins/newmail_notifier/localization/en_US.inc
|
||||
source_lang = en_US
|
||||
|
||||
[roundcube-webmail.plugin-password]
|
||||
file_filter = plugins/password/localization/<lang>.inc
|
||||
source_file = plugins/password/localization/en_US.inc
|
||||
source_lang = en_US
|
||||
|
||||
[roundcube-webmail.plugin-subscriptions_option]
|
||||
file_filter = plugins/subscriptions_option/localization/<lang>.inc
|
||||
source_file = plugins/subscriptions_option/localization/en_US.inc
|
||||
source_lang = en_US
|
||||
|
||||
[roundcube-webmail.plugin-userinfo]
|
||||
file_filter = plugins/userinfo/localization/<lang>.inc
|
||||
source_file = plugins/userinfo/localization/en_US.inc
|
||||
source_lang = en_US
|
||||
|
||||
[roundcube-webmail.plugin-vcard_attachments]
|
||||
file_filter = plugins/vcard_attachments/localization/<lang>.inc
|
||||
source_file = plugins/vcard_attachments/localization/en_US.inc
|
||||
source_lang = en_US
|
||||
|
||||
[roundcube-webmail.plugin-zipdownload]
|
||||
file_filter = plugins/zipdownload/localization/<lang>.inc
|
||||
source_file = plugins/zipdownload/localization/en_US.inc
|
||||
source_lang = en_US
|
@ -0,0 +1,59 @@
|
||||
Roundcube Webmail (http://roundcube.net)
|
||||
|
||||
|
||||
Introduction:
|
||||
-------------
|
||||
Roundcube Webmail is a browser-based multilingual IMAP client with an
|
||||
application-like user interface. It provides full functionality you expect
|
||||
from an e-mail client, including MIME support, address book, folder management,
|
||||
message searching and spell checking. Roundcube Webmail is written in PHP and
|
||||
requires the MySQL, PostgreSQL or SQLite database. With its plugin API it is
|
||||
easily extendable and the user interface is fully customizable using skins
|
||||
which are pure XHTML and CSS 2.
|
||||
|
||||
This project includes other open-source classes/libraries from PEAR
|
||||
(http://pear.php.net), an IMAP library derived from IlohaMail
|
||||
the TinyMCE rich text editor, Googiespell library for spell checking
|
||||
or the HTML sanitizer by Frederic Motte.
|
||||
|
||||
The current default skin uses icons designed by Stephen Horlander and Kevin
|
||||
Gerich for Mozilla.org.
|
||||
|
||||
|
||||
Installation:
|
||||
-------------
|
||||
For detailed instructions on how to install Roundcube webmail on your server,
|
||||
please refer to the INSTALL document in the same directory as this document.
|
||||
|
||||
If you're updating an older version of Roundcube please follow the steps
|
||||
described in the UPGRADING file.
|
||||
|
||||
|
||||
Licensing:
|
||||
----------
|
||||
This product is distributed under the GNU General Public License Version 2.
|
||||
Please read through the file LICENSE for more information about our license.
|
||||
|
||||
Even if skins might contain some programming work, they are not considered
|
||||
as a linked part of the application and therefore skins DO NOT fall under
|
||||
the provisions of the GPL license. See the README file located in the skins
|
||||
folder for details on the skin license.
|
||||
|
||||
|
||||
Contribution:
|
||||
-------------
|
||||
Want to help make Roundcube the best webmail solution ever?
|
||||
Roundcube is open source software. Our developers and contributors all
|
||||
are volunteers and we're always looking for new additions and resources.
|
||||
For more information visit http://roundcube.net/contribute
|
||||
|
||||
|
||||
Contact:
|
||||
--------
|
||||
For any bug reports or feature requests please refer to the tracking system
|
||||
at trac.roundcube.net (http://trac.roundcube.net/wiki/Howto_ReportIssues) or
|
||||
subscribe to our mailing list. See http://roundcube.net/support
|
||||
for details.
|
||||
|
||||
You're always welcome to send a message to the project admin:
|
||||
hello@roundcube.net
|
@ -1,104 +0,0 @@
|
||||
Roundcube Webmail
|
||||
=================
|
||||
[roundcube.net](https://roundcube.net)
|
||||
|
||||
[![Build Status](https://api.travis-ci.org/roundcube/roundcubemail.svg?branch=master)](https://travis-ci.org/roundcube/roundcubemail)
|
||||
|
||||
ATTENTION
|
||||
---------
|
||||
This is just a snapshot from the GIT repository and is **NOT A STABLE
|
||||
version of Roundcube**. It's not recommended to replace an existing installation
|
||||
of Roundcube with this version. Also using a separate database for this
|
||||
installation is highly recommended.
|
||||
|
||||
|
||||
INTRODUCTION
|
||||
------------
|
||||
Roundcube Webmail is a browser-based multilingual IMAP client with an
|
||||
application-like user interface. It provides full functionality you expect
|
||||
from an email client, including MIME support, address book, folder management,
|
||||
message searching and spell checking. Roundcube Webmail is written in PHP and
|
||||
requires the MySQL, PostgreSQL or SQLite database. With its plugin API it is
|
||||
easily extendable and the user interface is fully customizable using skins.
|
||||
|
||||
The code designed to run on a webserver is mainly written in PHP and Javascript.
|
||||
It includes a custom framework with an IMAP library derived from [IlohaMail][iloha]
|
||||
and requires a set of external libraries (see composer.json and jsdeps.json files).
|
||||
|
||||
|
||||
INSTALLATION
|
||||
------------
|
||||
For detailed instructions on how to install Roundcube webmail on your server,
|
||||
please refer to the INSTALL document in the same directory as this document.
|
||||
|
||||
If you're updating an older version of Roundcube please follow the steps
|
||||
described in the UPGRADING file.
|
||||
|
||||
|
||||
BROWSER SUPPORT
|
||||
---------------
|
||||
Roundcube uses jQuery 3.x for its client and therefore inherits the browser
|
||||
support from there. This currently includes:
|
||||
|
||||
- Chrome: (Current - 1) and Current
|
||||
- Edge: (Current - 1) and Current
|
||||
- Firefox: (Current - 1) and Current, ESR
|
||||
- Internet Explorer: 9+ (11+ for the Elastic skin)
|
||||
- Safari: (Current - 1) and Current
|
||||
- Opera: Current
|
||||
|
||||
|
||||
LICENSE
|
||||
-------
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License (**with exceptions
|
||||
for skins & plugins**) as published by the Free Software Foundation,
|
||||
either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see [www.gnu.org/licenses/][gpl].
|
||||
|
||||
This file forms part of the Roundcube Webmail Software for which the
|
||||
following exception is added: Plugins and Skins which merely make
|
||||
function calls to the Roundcube Webmail Software, and for that purpose
|
||||
include it by reference shall not be considered modifications of
|
||||
the software.
|
||||
|
||||
If you wish to use this file in another project or create a modified
|
||||
version that will not be part of the Roundcube Webmail Software, you
|
||||
may remove the exception above and use this source code under the
|
||||
original version of the license.
|
||||
|
||||
For more details about licensing and the exceptions for skins and plugins
|
||||
see [roundcube.net/license][license]
|
||||
|
||||
|
||||
CONTRIBUTION
|
||||
------------
|
||||
Want to help make Roundcube the best webmail solution ever?
|
||||
Roundcube is open source software. Our developers and contributors all
|
||||
are volunteers and we're always looking for new additions and resources.
|
||||
For more information visit [roundcube.net/contribute][contrib]
|
||||
|
||||
|
||||
CONTACT
|
||||
-------
|
||||
For bug reports or feature requests please refer to the tracking system
|
||||
at [Github][githubissues] or subscribe to our mailing list.
|
||||
See [roundcube.net/support][support] for details.
|
||||
|
||||
You're always welcome to send a message to the project admin:
|
||||
hello(at)roundcube(dot)net
|
||||
|
||||
|
||||
[iloha]: https://sourceforge.net/projects/ilohamail/
|
||||
[gpl]: https://www.gnu.org/licenses/
|
||||
[license]: https://roundcube.net/license
|
||||
[contrib]: https://roundcube.net/contribute
|
||||
[support]: https://roundcube.net/support
|
||||
[githubissues]: https://github.com/roundcube/roundcubemail/issues
|
@ -0,0 +1,251 @@
|
||||
-- Roundcube Webmail update script for MSSQL databases
|
||||
|
||||
-- Updates from version 0.3.1
|
||||
|
||||
ALTER TABLE [dbo].[messages] ADD CONSTRAINT [FK_messages_user_id]
|
||||
FOREIGN KEY ([user_id]) REFERENCES [dbo].[users] ([user_id])
|
||||
ON DELETE CASCADE ON UPDATE CASCADE
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[cache] ADD CONSTRAINT [FK_cache_user_id]
|
||||
FOREIGN KEY ([user_id]) REFERENCES [dbo].[users] ([user_id])
|
||||
ON DELETE CASCADE ON UPDATE CASCADE
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[contacts] ADD CONSTRAINT [FK_contacts_user_id]
|
||||
FOREIGN KEY ([user_id]) REFERENCES [dbo].[users] ([user_id])
|
||||
ON DELETE CASCADE ON UPDATE CASCADE
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[identities] ADD CONSTRAINT [FK_identities_user_id]
|
||||
FOREIGN KEY ([user_id]) REFERENCES [dbo].[users] ([user_id])
|
||||
ON DELETE CASCADE ON UPDATE CASCADE
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[identities] ADD [changed] [datetime] NULL
|
||||
GO
|
||||
|
||||
CREATE TABLE [dbo].[contactgroups] (
|
||||
[contactgroup_id] [int] IDENTITY (1, 1) NOT NULL ,
|
||||
[user_id] [int] NOT NULL ,
|
||||
[changed] [datetime] NOT NULL ,
|
||||
[del] [char] (1) COLLATE Latin1_General_CI_AI NOT NULL ,
|
||||
[name] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL
|
||||
) ON [PRIMARY]
|
||||
GO
|
||||
|
||||
CREATE TABLE [dbo].[contactgroupmembers] (
|
||||
[contactgroup_id] [int] NOT NULL ,
|
||||
[contact_id] [int] NOT NULL ,
|
||||
[created] [datetime] NOT NULL
|
||||
) ON [PRIMARY]
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[contactgroups] WITH NOCHECK ADD
|
||||
CONSTRAINT [PK_contactgroups_contactgroup_id] PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[contactgroup_id]
|
||||
) ON [PRIMARY]
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[contactgroupmembers] WITH NOCHECK ADD
|
||||
CONSTRAINT [PK_contactgroupmembers_id] PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[contactgroup_id], [contact_id]
|
||||
) ON [PRIMARY]
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[contactgroups] ADD
|
||||
CONSTRAINT [DF_contactgroups_user_id] DEFAULT (0) FOR [user_id],
|
||||
CONSTRAINT [DF_contactgroups_changed] DEFAULT (getdate()) FOR [changed],
|
||||
CONSTRAINT [DF_contactgroups_del] DEFAULT ('0') FOR [del],
|
||||
CONSTRAINT [DF_contactgroups_name] DEFAULT ('') FOR [name],
|
||||
CONSTRAINT [CK_contactgroups_del] CHECK ([del] = '1' or [del] = '0')
|
||||
GO
|
||||
|
||||
CREATE INDEX [IX_contactgroups_user_id] ON [dbo].[contacts]([user_id]) ON [PRIMARY]
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[contactgroupmembers] ADD
|
||||
CONSTRAINT [DF_contactgroupmembers_contactgroup_id] DEFAULT (0) FOR [contactgroup_id],
|
||||
CONSTRAINT [DF_contactgroupmembers_contact_id] DEFAULT (0) FOR [contact_id],
|
||||
CONSTRAINT [DF_contactgroupmembers_created] DEFAULT (getdate()) FOR [created]
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[contactgroupmembers] ADD CONSTRAINT [FK_contactgroupmembers_contactgroup_id]
|
||||
FOREIGN KEY ([contactgroup_id]) REFERENCES [dbo].[contactgroups] ([contactgroup_id])
|
||||
ON DELETE CASCADE ON UPDATE CASCADE
|
||||
GO
|
||||
|
||||
CREATE TRIGGER [contact_delete_member] ON [dbo].[contacts]
|
||||
AFTER DELETE AS
|
||||
DELETE FROM [dbo].[contactgroupmembers]
|
||||
WHERE [contact_id] IN (SELECT [contact_id] FROM deleted)
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[contactgroups] ADD CONSTRAINT [FK_contactgroups_user_id]
|
||||
FOREIGN KEY ([user_id]) REFERENCES [dbo].[users] ([user_id])
|
||||
ON DELETE CASCADE ON UPDATE CASCADE
|
||||
GO
|
||||
|
||||
-- Updates from version 0.4.2
|
||||
|
||||
DROP INDEX [IX_users_username]
|
||||
GO
|
||||
CREATE UNIQUE INDEX [IX_users_username] ON [dbo].[users]([username],[mail_host]) ON [PRIMARY]
|
||||
GO
|
||||
ALTER TABLE [dbo].[contacts] ALTER COLUMN [email] [varchar] (255) COLLATE Latin1_General_CI_AI NOT NULL
|
||||
GO
|
||||
|
||||
-- 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
|
||||
GO
|
||||
CREATE INDEX [IX_contactgroupmembers_contact_id] ON [dbo].[contactgroupmembers]([contact_id]) ON [PRIMARY]
|
||||
GO
|
||||
DELETE FROM [dbo].[messages]
|
||||
GO
|
||||
DELETE FROM [dbo].[cache]
|
||||
GO
|
||||
|
||||
-- Updates from version 0.6
|
||||
|
||||
CREATE TABLE [dbo].[dictionary] (
|
||||
[user_id] [int] ,
|
||||
[language] [varchar] (5) COLLATE Latin1_General_CI_AI NOT NULL ,
|
||||
[data] [text] COLLATE Latin1_General_CI_AI NOT NULL
|
||||
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
|
||||
GO
|
||||
CREATE UNIQUE INDEX [IX_dictionary_user_language] ON [dbo].[dictionary]([user_id],[language]) ON [PRIMARY]
|
||||
GO
|
||||
|
||||
CREATE TABLE [dbo].[searches] (
|
||||
[search_id] [int] IDENTITY (1, 1) NOT NULL ,
|
||||
[user_id] [int] NOT NULL ,
|
||||
[type] [tinyint] NOT NULL ,
|
||||
[name] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL ,
|
||||
[data] [text] COLLATE Latin1_General_CI_AI NOT NULL
|
||||
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[searches] WITH NOCHECK ADD
|
||||
CONSTRAINT [PK_searches_search_id] PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[search_id]
|
||||
) ON [PRIMARY]
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[searches] ADD
|
||||
CONSTRAINT [DF_searches_user] DEFAULT (0) FOR [user_id],
|
||||
CONSTRAINT [DF_searches_type] DEFAULT (0) FOR [type],
|
||||
GO
|
||||
|
||||
CREATE UNIQUE INDEX [IX_searches_user_type_name] ON [dbo].[searches]([user_id],[type],[name]) ON [PRIMARY]
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[searches] ADD CONSTRAINT [FK_searches_user_id]
|
||||
FOREIGN KEY ([user_id]) REFERENCES [dbo].[users] ([user_id])
|
||||
ON DELETE CASCADE ON UPDATE CASCADE
|
||||
GO
|
||||
|
||||
DROP TABLE [dbo].[messages]
|
||||
GO
|
||||
CREATE TABLE [dbo].[cache_index] (
|
||||
[user_id] [int] NOT NULL ,
|
||||
[mailbox] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL ,
|
||||
[changed] [datetime] NOT NULL ,
|
||||
[valid] [char] (1) COLLATE Latin1_General_CI_AI NOT NULL ,
|
||||
[data] [text] COLLATE Latin1_General_CI_AI NOT NULL
|
||||
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
|
||||
GO
|
||||
|
||||
CREATE TABLE [dbo].[cache_thread] (
|
||||
[user_id] [int] NOT NULL ,
|
||||
[mailbox] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL ,
|
||||
[changed] [datetime] NOT NULL ,
|
||||
[data] [text] COLLATE Latin1_General_CI_AI NOT NULL
|
||||
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
|
||||
GO
|
||||
|
||||
CREATE TABLE [dbo].[cache_messages] (
|
||||
[user_id] [int] NOT NULL ,
|
||||
[mailbox] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL ,
|
||||
[uid] [int] NOT NULL ,
|
||||
[changed] [datetime] NOT NULL ,
|
||||
[data] [text] COLLATE Latin1_General_CI_AI NOT NULL ,
|
||||
[flags] [int] NOT NULL
|
||||
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[cache_index] WITH NOCHECK ADD
|
||||
PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[user_id],[mailbox]
|
||||
) ON [PRIMARY]
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[cache_thread] WITH NOCHECK ADD
|
||||
PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[user_id],[mailbox]
|
||||
) ON [PRIMARY]
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[cache_messages] WITH NOCHECK ADD
|
||||
PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[user_id],[mailbox],[uid]
|
||||
) ON [PRIMARY]
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[cache_index] ADD
|
||||
CONSTRAINT [DF_cache_index_changed] DEFAULT (getdate()) FOR [changed],
|
||||
CONSTRAINT [DF_cache_index_valid] DEFAULT ('0') FOR [valid]
|
||||
GO
|
||||
|
||||
CREATE INDEX [IX_cache_index_user_id] ON [dbo].[cache_index]([user_id]) ON [PRIMARY]
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[cache_thread] ADD
|
||||
CONSTRAINT [DF_cache_thread_changed] DEFAULT (getdate()) FOR [changed]
|
||||
GO
|
||||
|
||||
CREATE INDEX [IX_cache_thread_user_id] ON [dbo].[cache_thread]([user_id]) ON [PRIMARY]
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[cache_messages] ADD
|
||||
CONSTRAINT [DF_cache_messages_changed] DEFAULT (getdate()) FOR [changed],
|
||||
CONSTRAINT [DF_cache_messages_flags] DEFAULT (0) FOR [flags]
|
||||
GO
|
||||
|
||||
CREATE INDEX [IX_cache_messages_user_id] ON [dbo].[cache_messages]([user_id]) ON [PRIMARY]
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[cache_index] ADD CONSTRAINT [FK_cache_index_user_id]
|
||||
FOREIGN KEY ([user_id]) REFERENCES [dbo].[users] ([user_id])
|
||||
ON DELETE CASCADE ON UPDATE CASCADE
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[cache_thread] ADD CONSTRAINT [FK_cache_thread_user_id]
|
||||
FOREIGN KEY ([user_id]) REFERENCES [dbo].[users] ([user_id])
|
||||
ON DELETE CASCADE ON UPDATE CASCADE
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[cache_messages] ADD CONSTRAINT [FK_cache_messages_user_id]
|
||||
FOREIGN KEY ([user_id]) REFERENCES [dbo].[users] ([user_id])
|
||||
ON DELETE CASCADE ON UPDATE CASCADE
|
||||
GO
|
||||
|
||||
-- Updates from version 0.7-beta
|
||||
|
||||
ALTER TABLE [dbo].[session] ALTER COLUMN [sess_id] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL
|
||||
GO
|
||||
|
||||
-- Updates from version 0.7
|
||||
|
||||
ALTER TABLE [dbo].[contacts] ALTER COLUMN [email] [text] COLLATE Latin1_General_CI_AI NOT NULL
|
||||
GO
|
||||
|
@ -1,87 +0,0 @@
|
||||
-- Updates from version 0.3.1
|
||||
|
||||
ALTER TABLE [dbo].[messages] ADD CONSTRAINT [FK_messages_user_id]
|
||||
FOREIGN KEY ([user_id]) REFERENCES [dbo].[users] ([user_id])
|
||||
ON DELETE CASCADE ON UPDATE CASCADE
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[cache] ADD CONSTRAINT [FK_cache_user_id]
|
||||
FOREIGN KEY ([user_id]) REFERENCES [dbo].[users] ([user_id])
|
||||
ON DELETE CASCADE ON UPDATE CASCADE
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[contacts] ADD CONSTRAINT [FK_contacts_user_id]
|
||||
FOREIGN KEY ([user_id]) REFERENCES [dbo].[users] ([user_id])
|
||||
ON DELETE CASCADE ON UPDATE CASCADE
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[identities] ADD CONSTRAINT [FK_identities_user_id]
|
||||
FOREIGN KEY ([user_id]) REFERENCES [dbo].[users] ([user_id])
|
||||
ON DELETE CASCADE ON UPDATE CASCADE
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[identities] ADD [changed] [datetime] NULL
|
||||
GO
|
||||
|
||||
CREATE TABLE [dbo].[contactgroups] (
|
||||
[contactgroup_id] [int] IDENTITY (1, 1) NOT NULL ,
|
||||
[user_id] [int] NOT NULL ,
|
||||
[changed] [datetime] NOT NULL ,
|
||||
[del] [char] (1) COLLATE Latin1_General_CI_AI NOT NULL ,
|
||||
[name] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL
|
||||
) ON [PRIMARY]
|
||||
GO
|
||||
|
||||
CREATE TABLE [dbo].[contactgroupmembers] (
|
||||
[contactgroup_id] [int] NOT NULL ,
|
||||
[contact_id] [int] NOT NULL ,
|
||||
[created] [datetime] NOT NULL
|
||||
) ON [PRIMARY]
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[contactgroups] WITH NOCHECK ADD
|
||||
CONSTRAINT [PK_contactgroups_contactgroup_id] PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[contactgroup_id]
|
||||
) ON [PRIMARY]
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[contactgroupmembers] WITH NOCHECK ADD
|
||||
CONSTRAINT [PK_contactgroupmembers_id] PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[contactgroup_id], [contact_id]
|
||||
) ON [PRIMARY]
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[contactgroups] ADD
|
||||
CONSTRAINT [DF_contactgroups_user_id] DEFAULT (0) FOR [user_id],
|
||||
CONSTRAINT [DF_contactgroups_changed] DEFAULT (getdate()) FOR [changed],
|
||||
CONSTRAINT [DF_contactgroups_del] DEFAULT ('0') FOR [del],
|
||||
CONSTRAINT [DF_contactgroups_name] DEFAULT ('') FOR [name],
|
||||
CONSTRAINT [CK_contactgroups_del] CHECK ([del] = '1' or [del] = '0')
|
||||
GO
|
||||
|
||||
CREATE INDEX [IX_contactgroups_user_id] ON [dbo].[contacts]([user_id]) ON [PRIMARY]
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[contactgroupmembers] ADD
|
||||
CONSTRAINT [DF_contactgroupmembers_contactgroup_id] DEFAULT (0) FOR [contactgroup_id],
|
||||
CONSTRAINT [DF_contactgroupmembers_contact_id] DEFAULT (0) FOR [contact_id],
|
||||
CONSTRAINT [DF_contactgroupmembers_created] DEFAULT (getdate()) FOR [created]
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[contactgroupmembers] ADD CONSTRAINT [FK_contactgroupmembers_contactgroup_id]
|
||||
FOREIGN KEY ([contactgroup_id]) REFERENCES [dbo].[contactgroups] ([contactgroup_id])
|
||||
ON DELETE CASCADE ON UPDATE CASCADE
|
||||
GO
|
||||
|
||||
CREATE TRIGGER [contact_delete_member] ON [dbo].[contacts]
|
||||
AFTER DELETE AS
|
||||
DELETE FROM [dbo].[contactgroupmembers]
|
||||
WHERE [contact_id] IN (SELECT [contact_id] FROM deleted)
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[contactgroups] ADD CONSTRAINT [FK_contactgroups_user_id]
|
||||
FOREIGN KEY ([user_id]) REFERENCES [dbo].[users] ([user_id])
|
||||
ON DELETE CASCADE ON UPDATE CASCADE
|
||||
GO
|
@ -1,9 +0,0 @@
|
||||
-- Updates from version 0.4.2
|
||||
|
||||
DROP INDEX [IX_users_username]
|
||||
GO
|
||||
CREATE UNIQUE INDEX [IX_users_username] ON [dbo].[users]([username],[mail_host]) ON [PRIMARY]
|
||||
GO
|
||||
ALTER TABLE [dbo].[contacts] ALTER COLUMN [email] [varchar] (255) COLLATE Latin1_General_CI_AI NOT NULL
|
||||
GO
|
||||
|
@ -1,10 +0,0 @@
|
||||
-- Updates from version 0.5.x
|
||||
|
||||
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
|
||||
DELETE FROM [dbo].[messages]
|
||||
GO
|
||||
DELETE FROM [dbo].[cache]
|
||||
GO
|
@ -1,127 +0,0 @@
|
||||
-- Updates from version 0.6
|
||||
|
||||
CREATE TABLE [dbo].[dictionary] (
|
||||
[user_id] [int] ,
|
||||
[language] [varchar] (5) COLLATE Latin1_General_CI_AI NOT NULL ,
|
||||
[data] [text] COLLATE Latin1_General_CI_AI NOT NULL
|
||||
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
|
||||
GO
|
||||
CREATE UNIQUE INDEX [IX_dictionary_user_language] ON [dbo].[dictionary]([user_id],[language]) ON [PRIMARY]
|
||||
GO
|
||||
|
||||
CREATE TABLE [dbo].[searches] (
|
||||
[search_id] [int] IDENTITY (1, 1) NOT NULL ,
|
||||
[user_id] [int] NOT NULL ,
|
||||
[type] [tinyint] NOT NULL ,
|
||||
[name] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL ,
|
||||
[data] [text] COLLATE Latin1_General_CI_AI NOT NULL
|
||||
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[searches] WITH NOCHECK ADD
|
||||
CONSTRAINT [PK_searches_search_id] PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[search_id]
|
||||
) ON [PRIMARY]
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[searches] ADD
|
||||
CONSTRAINT [DF_searches_user] DEFAULT (0) FOR [user_id],
|
||||
CONSTRAINT [DF_searches_type] DEFAULT (0) FOR [type],
|
||||
GO
|
||||
|
||||
CREATE UNIQUE INDEX [IX_searches_user_type_name] ON [dbo].[searches]([user_id],[type],[name]) ON [PRIMARY]
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[searches] ADD CONSTRAINT [FK_searches_user_id]
|
||||
FOREIGN KEY ([user_id]) REFERENCES [dbo].[users] ([user_id])
|
||||
ON DELETE CASCADE ON UPDATE CASCADE
|
||||
GO
|
||||
|
||||
DROP TABLE [dbo].[messages]
|
||||
GO
|
||||
CREATE TABLE [dbo].[cache_index] (
|
||||
[user_id] [int] NOT NULL ,
|
||||
[mailbox] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL ,
|
||||
[changed] [datetime] NOT NULL ,
|
||||
[valid] [char] (1) COLLATE Latin1_General_CI_AI NOT NULL ,
|
||||
[data] [text] COLLATE Latin1_General_CI_AI NOT NULL
|
||||
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
|
||||
GO
|
||||
|
||||
CREATE TABLE [dbo].[cache_thread] (
|
||||
[user_id] [int] NOT NULL ,
|
||||
[mailbox] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL ,
|
||||
[changed] [datetime] NOT NULL ,
|
||||
[data] [text] COLLATE Latin1_General_CI_AI NOT NULL
|
||||
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
|
||||
GO
|
||||
|
||||
CREATE TABLE [dbo].[cache_messages] (
|
||||
[user_id] [int] NOT NULL ,
|
||||
[mailbox] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL ,
|
||||
[uid] [int] NOT NULL ,
|
||||
[changed] [datetime] NOT NULL ,
|
||||
[data] [text] COLLATE Latin1_General_CI_AI NOT NULL ,
|
||||
[flags] [int] NOT NULL
|
||||
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[cache_index] WITH NOCHECK ADD
|
||||
PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[user_id],[mailbox]
|
||||
) ON [PRIMARY]
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[cache_thread] WITH NOCHECK ADD
|
||||
PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[user_id],[mailbox]
|
||||
) ON [PRIMARY]
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[cache_messages] WITH NOCHECK ADD
|
||||
PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[user_id],[mailbox],[uid]
|
||||
) ON [PRIMARY]
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[cache_index] ADD
|
||||
CONSTRAINT [DF_cache_index_changed] DEFAULT (getdate()) FOR [changed],
|
||||
CONSTRAINT [DF_cache_index_valid] DEFAULT ('0') FOR [valid]
|
||||
GO
|
||||
|
||||
CREATE INDEX [IX_cache_index_user_id] ON [dbo].[cache_index]([user_id]) ON [PRIMARY]
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[cache_thread] ADD
|
||||
CONSTRAINT [DF_cache_thread_changed] DEFAULT (getdate()) FOR [changed]
|
||||
GO
|
||||
|
||||
CREATE INDEX [IX_cache_thread_user_id] ON [dbo].[cache_thread]([user_id]) ON [PRIMARY]
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[cache_messages] ADD
|
||||
CONSTRAINT [DF_cache_messages_changed] DEFAULT (getdate()) FOR [changed],
|
||||
CONSTRAINT [DF_cache_messages_flags] DEFAULT (0) FOR [flags]
|
||||
GO
|
||||
|
||||
CREATE INDEX [IX_cache_messages_user_id] ON [dbo].[cache_messages]([user_id]) ON [PRIMARY]
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[cache_index] ADD CONSTRAINT [FK_cache_index_user_id]
|
||||
FOREIGN KEY ([user_id]) REFERENCES [dbo].[users] ([user_id])
|
||||
ON DELETE CASCADE ON UPDATE CASCADE
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[cache_thread] ADD CONSTRAINT [FK_cache_thread_user_id]
|
||||
FOREIGN KEY ([user_id]) REFERENCES [dbo].[users] ([user_id])
|
||||
ON DELETE CASCADE ON UPDATE CASCADE
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[cache_messages] ADD CONSTRAINT [FK_cache_messages_user_id]
|
||||
FOREIGN KEY ([user_id]) REFERENCES [dbo].[users] ([user_id])
|
||||
ON DELETE CASCADE ON UPDATE CASCADE
|
||||
GO
|
@ -1,4 +0,0 @@
|
||||
-- Updates from version 0.7-beta
|
||||
|
||||
ALTER TABLE [dbo].[session] ALTER COLUMN [sess_id] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL
|
||||
GO
|
@ -1,9 +0,0 @@
|
||||
-- Updates from version 0.7
|
||||
|
||||
ALTER TABLE [dbo].[contacts] DROP CONSTRAINT [DF_contacts_email]
|
||||
GO
|
||||
ALTER TABLE [dbo].[contacts] ALTER COLUMN [email] [text] COLLATE Latin1_General_CI_AI NOT NULL
|
||||
GO
|
||||
ALTER TABLE [dbo].[contacts] ADD CONSTRAINT [DF_contacts_email] DEFAULT ('') FOR [email]
|
||||
GO
|
||||
|
@ -1,18 +0,0 @@
|
||||
-- Updates from version 0.8-rc
|
||||
|
||||
ALTER TABLE [dbo].[contacts] DROP CONSTRAINT [DF_contacts_email]
|
||||
GO
|
||||
ALTER TABLE [dbo].[contacts] ALTER COLUMN [email] [varchar] (8000) COLLATE Latin1_General_CI_AI NOT NULL
|
||||
GO
|
||||
ALTER TABLE [dbo].[contacts] ADD CONSTRAINT [DF_contacts_email] DEFAULT ('') FOR [email]
|
||||
GO
|
||||
|
||||
-- Updates from version 0.8
|
||||
|
||||
ALTER TABLE [dbo].[cache] DROP COLUMN [cache_id]
|
||||
GO
|
||||
ALTER TABLE [dbo].[users] DROP COLUMN [alias]
|
||||
GO
|
||||
CREATE INDEX [IX_identities_email] ON [dbo].[identities]([email],[del]) ON [PRIMARY]
|
||||
GO
|
||||
|
@ -1,8 +0,0 @@
|
||||
-- Updates from version 0.8
|
||||
|
||||
ALTER TABLE [dbo].[cache] DROP COLUMN [cache_id]
|
||||
GO
|
||||
ALTER TABLE [dbo].[users] DROP COLUMN [alias]
|
||||
GO
|
||||
CREATE INDEX [IX_identities_email] ON [dbo].[identities]([email],[del]) ON [PRIMARY]
|
||||
GO
|
@ -1,14 +0,0 @@
|
||||
-- Upgrades from 0.9-beta
|
||||
|
||||
CREATE TABLE [dbo].[system] (
|
||||
[name] [varchar] (64) COLLATE Latin1_General_CI_AI NOT NULL ,
|
||||
[value] [text] COLLATE Latin1_General_CI_AI
|
||||
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[system] WITH NOCHECK ADD
|
||||
CONSTRAINT [PK_system_name] PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[name]
|
||||
) ON [PRIMARY]
|
||||
GO
|
@ -1 +0,0 @@
|
||||
-- empty
|
@ -1,17 +0,0 @@
|
||||
CREATE TABLE [dbo].[cache_shared] (
|
||||
[cache_key] [varchar] (255) COLLATE Latin1_General_CI_AI NOT NULL ,
|
||||
[created] [datetime] NOT NULL ,
|
||||
[data] [text] COLLATE Latin1_General_CI_AI NOT NULL
|
||||
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[cache_shared] ADD
|
||||
CONSTRAINT [DF_cache_shared_created] DEFAULT (getdate()) FOR [created]
|
||||
GO
|
||||
|
||||
CREATE INDEX [IX_cache_shared_cache_key] ON [dbo].[cache_shared]([cache_key]) ON [PRIMARY]
|
||||
GO
|
||||
|
||||
CREATE INDEX [IX_cache_shared_created] ON [dbo].[cache_shared]([created]) ON [PRIMARY]
|
||||
GO
|
||||
|
@ -1,44 +0,0 @@
|
||||
ALTER TABLE [dbo].[cache] ADD [expires] [datetime] NULL
|
||||
GO
|
||||
ALTER TABLE [dbo].[cache_shared] ADD [expires] [datetime] NULL
|
||||
GO
|
||||
ALTER TABLE [dbo].[cache_index] ADD [expires] [datetime] NULL
|
||||
GO
|
||||
ALTER TABLE [dbo].[cache_thread] ADD [expires] [datetime] NULL
|
||||
GO
|
||||
ALTER TABLE [dbo].[cache_messages] ADD [expires] [datetime] NULL
|
||||
GO
|
||||
|
||||
UPDATE [dbo].[cache] SET [expires] = DATEADD(second, 604800, [created])
|
||||
GO
|
||||
UPDATE [dbo].[cache_shared] SET [expires] = DATEADD(second, 604800, [created])
|
||||
GO
|
||||
UPDATE [dbo].[cache_index] SET [expires] = DATEADD(second, 604800, [changed])
|
||||
GO
|
||||
UPDATE [dbo].[cache_thread] SET [expires] = DATEADD(second, 604800, [changed])
|
||||
GO
|
||||
UPDATE [dbo].[cache_messages] SET [expires] = DATEADD(second, 604800, [changed])
|
||||
GO
|
||||
|
||||
DROP INDEX [IX_cache_created]
|
||||
GO
|
||||
DROP INDEX [IX_cache_shared_created]
|
||||
GO
|
||||
ALTER TABLE [dbo].[cache_index] DROP COLUMN [changed]
|
||||
GO
|
||||
ALTER TABLE [dbo].[cache_thread] DROP COLUMN [changed]
|
||||
GO
|
||||
ALTER TABLE [dbo].[cache_messages] DROP COLUMN [changed]
|
||||
GO
|
||||
|
||||
CREATE INDEX [IX_cache_expires] ON [dbo].[cache]([expires]) ON [PRIMARY]
|
||||
GO
|
||||
CREATE INDEX [IX_cache_shared_expires] ON [dbo].[cache_shared]([expires]) ON [PRIMARY]
|
||||
GO
|
||||
CREATE INDEX [IX_cache_index_expires] ON [dbo].[cache_index]([expires]) ON [PRIMARY]
|
||||
GO
|
||||
CREATE INDEX [IX_cache_thread_expires] ON [dbo].[cache_thread]([expires]) ON [PRIMARY]
|
||||
GO
|
||||
CREATE INDEX [IX_cache_messages_expires] ON [dbo].[cache_messages]([expires]) ON [PRIMARY]
|
||||
GO
|
||||
|
@ -1 +0,0 @@
|
||||
-- empty
|
@ -1 +0,0 @@
|
||||
-- empty
|
@ -1,4 +0,0 @@
|
||||
ALTER TABLE [dbo].[users] ADD [failed_login] [datetime] NULL
|
||||
GO
|
||||
ALTER TABLE [dbo].[users] ADD [failed_login_counter] [int] NULL
|
||||
GO
|
@ -1,2 +0,0 @@
|
||||
ALTER TABLE [dbo].[session] DROP COLUMN [created]
|
||||
GO
|
@ -1,2 +0,0 @@
|
||||
ALTER TABLE [dbo].[session] ALTER COLUMN [ip] [varchar] (40) COLLATE Latin1_General_CI_AI NOT NULL
|
||||
GO
|
@ -1,36 +0,0 @@
|
||||
DROP TABLE [dbo].[cache]
|
||||
GO
|
||||
DROP TABLE [dbo].[cache_shared]
|
||||
GO
|
||||
|
||||
CREATE TABLE [dbo].[cache] (
|
||||
[user_id] [int] NOT NULL ,
|
||||
[cache_key] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL ,
|
||||
[expires] [datetime] NULL ,
|
||||
[data] [text] COLLATE Latin1_General_CI_AI NOT NULL
|
||||
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
|
||||
GO
|
||||
CREATE TABLE [dbo].[cache_shared] (
|
||||
[cache_key] [varchar] (255) COLLATE Latin1_General_CI_AI NOT NULL ,
|
||||
[expires] [datetime] NULL ,
|
||||
[data] [text] COLLATE Latin1_General_CI_AI NOT NULL
|
||||
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
|
||||
GO
|
||||
ALTER TABLE [dbo].[cache] ADD
|
||||
CONSTRAINT [DF_cache_user_id] DEFAULT ('0') FOR [user_id],
|
||||
CONSTRAINT [DF_cache_cache_key] DEFAULT ('') FOR [cache_key],
|
||||
GO
|
||||
CREATE INDEX [IX_cache_expires] ON [dbo].[cache]([expires]) ON [PRIMARY]
|
||||
GO
|
||||
CREATE INDEX [IX_cache_shared_expires] ON [dbo].[cache_shared]([expires]) ON [PRIMARY]
|
||||
GO
|
||||
ALTER TABLE [dbo].[cache] WITH NOCHECK ADD
|
||||
PRIMARY KEY CLUSTERED (
|
||||
[user_id],[cache_key]
|
||||
) ON [PRIMARY]
|
||||
GO
|
||||
ALTER TABLE [dbo].[cache_shared] WITH NOCHECK ADD
|
||||
PRIMARY KEY CLUSTERED (
|
||||
[cache_key]
|
||||
) ON [PRIMARY]
|
||||
GO
|
@ -1,24 +0,0 @@
|
||||
CREATE TABLE [dbo].[filestore] (
|
||||
[file_id] [int] IDENTITY (1, 1) NOT NULL ,
|
||||
[user_id] [int] NOT NULL ,
|
||||
[filename] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL ,
|
||||
[mtime] [int] NOT NULL ,
|
||||
[data] [text] COLLATE Latin1_General_CI_AI NULL ,
|
||||
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[filestore] WITH NOCHECK ADD
|
||||
CONSTRAINT [PK_filestore_file_id] PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[file_id]
|
||||
) ON [PRIMARY]
|
||||
GO
|
||||
|
||||
CREATE INDEX [IX_filestore_user_id] ON [dbo].[filestore]([user_id]) ON [PRIMARY]
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[filestore] ADD CONSTRAINT [FK_filestore_user_id]
|
||||
FOREIGN KEY ([user_id]) REFERENCES [dbo].[users] ([user_id])
|
||||
ON DELETE CASCADE ON UPDATE CASCADE
|
||||
GO
|
||||
|
@ -1,9 +0,0 @@
|
||||
ALTER TABLE [dbo].[filestore] ADD COLUMN [context] [varchar] (32) COLLATE Latin1_General_CI_AI NOT NULL
|
||||
GO
|
||||
|
||||
UPDATE [dbo].[filestore] SET [dbo].[context] = 'enigma'
|
||||
GO
|
||||
|
||||
CREATE UNIQUE INDEX [IX_filestore_user_id_context_filename] ON [dbo].[filestore]([user_id],[context],[filename]) ON [PRIMARY]
|
||||
GO
|
||||
|
@ -1,18 +0,0 @@
|
||||
ALTER TABLE [dbo].[cache] ALTER COLUMN
|
||||
[cache_key] [varchar] (128) COLLATE Latin1_General_CS_AS NOT NULL
|
||||
GO
|
||||
ALTER TABLE [dbo].[cache_shared] ALTER COLUMN
|
||||
[cache_key] [varchar] (255) COLLATE Latin1_General_CS_AS NOT NULL
|
||||
GO
|
||||
ALTER TABLE [dbo].[cache_index] ALTER COLUMN
|
||||
[mailbox] [varchar] (128) COLLATE Latin1_General_CS_AS NOT NULL
|
||||
GO
|
||||
ALTER TABLE [dbo].[cache_messages] ALTER COLUMN
|
||||
[mailbox] [varchar] (128) COLLATE Latin1_General_CS_AS NOT NULL
|
||||
GO
|
||||
ALTER TABLE [dbo].[cache_thread] ALTER COLUMN
|
||||
[mailbox] [varchar] (128) COLLATE Latin1_General_CS_AS NOT NULL
|
||||
GO
|
||||
ALTER TABLE [dbo].[users] ALTER COLUMN
|
||||
[username] [varchar] (128) COLLATE Latin1_General_CS_AS NOT NULL
|
||||
GO
|
@ -1,4 +0,0 @@
|
||||
ALTER TABLE [dbo].[users] ALTER COLUMN [language] [varchar] (16) COLLATE Latin1_General_CI_AI NULL
|
||||
GO
|
||||
ALTER TABLE [dbo].[dictionary] ALTER COLUMN [language] [varchar] (16) COLLATE Latin1_General_CI_AI NOT NULL
|
||||
GO
|
@ -1 +0,0 @@
|
||||
-- empty
|
@ -0,0 +1,237 @@
|
||||
-- Roundcube Webmail update script for MySQL databases
|
||||
|
||||
-- Updates from version 0.1-stable
|
||||
|
||||
TRUNCATE TABLE `messages`;
|
||||
|
||||
ALTER TABLE `messages`
|
||||
DROP INDEX `idx`,
|
||||
DROP INDEX `uid`;
|
||||
|
||||
ALTER TABLE `cache`
|
||||
DROP INDEX `cache_key`,
|
||||
DROP INDEX `session_id`,
|
||||
ADD INDEX `user_cache_index` (`user_id`,`cache_key`);
|
||||
|
||||
ALTER TABLE `users`
|
||||
ADD INDEX `username_index` (`username`),
|
||||
ADD INDEX `alias_index` (`alias`);
|
||||
|
||||
-- Updates from version 0.1.1
|
||||
|
||||
ALTER TABLE `identities`
|
||||
MODIFY `signature` text,
|
||||
MODIFY `bcc` varchar(128) NOT NULL DEFAULT '',
|
||||
MODIFY `reply-to` varchar(128) NOT NULL DEFAULT '',
|
||||
MODIFY `organization` varchar(128) NOT NULL DEFAULT '',
|
||||
MODIFY `name` varchar(128) NOT NULL,
|
||||
MODIFY `email` varchar(128) NOT NULL;
|
||||
|
||||
-- Updates from version 0.2-alpha
|
||||
|
||||
ALTER TABLE `messages`
|
||||
ADD INDEX `created_index` (`created`);
|
||||
|
||||
-- Updates from version 0.2-beta (InnoDB required)
|
||||
|
||||
ALTER TABLE `cache`
|
||||
DROP `session_id`;
|
||||
|
||||
ALTER TABLE `session`
|
||||
ADD INDEX `changed_index` (`changed`);
|
||||
|
||||
ALTER TABLE `cache`
|
||||
ADD INDEX `created_index` (`created`);
|
||||
|
||||
ALTER TABLE `users`
|
||||
CHANGE `language` `language` varchar(5);
|
||||
|
||||
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;
|
||||
|
||||
TRUNCATE TABLE `messages`;
|
||||
|
||||
-- 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` CHANGE `vcard` `vcard` LONGTEXT /*!40101 CHARACTER SET utf8 */ NULL DEFAULT NULL;
|
||||
ALTER TABLE `contactgroupmembers` ADD INDEX `contactgroupmembers_contact_index` (`contact_id`);
|
||||
|
||||
TRUNCATE TABLE `messages`;
|
||||
TRUNCATE TABLE `cache`;
|
||||
|
||||
-- Updates from version 0.6
|
||||
|
||||
ALTER TABLE `users` CHANGE `alias` `alias` varchar(128) BINARY NOT NULL;
|
||||
ALTER TABLE `users` CHANGE `username` `username` varchar(128) BINARY NOT NULL;
|
||||
|
||||
CREATE TABLE `dictionary` (
|
||||
`user_id` int(10) UNSIGNED DEFAULT NULL,
|
||||
`language` varchar(5) NOT NULL,
|
||||
`data` longtext NOT NULL,
|
||||
CONSTRAINT `user_id_fk_dictionary` FOREIGN KEY (`user_id`)
|
||||
REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
UNIQUE `uniqueness` (`user_id`, `language`)
|
||||
) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
|
||||
|
||||
CREATE TABLE `searches` (
|
||||
`search_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`user_id` int(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||
`type` int(3) NOT NULL DEFAULT '0',
|
||||
`name` varchar(128) NOT NULL,
|
||||
`data` text,
|
||||
PRIMARY KEY(`search_id`),
|
||||
CONSTRAINT `user_id_fk_searches` FOREIGN KEY (`user_id`)
|
||||
REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
UNIQUE `uniqueness` (`user_id`, `type`, `name`)
|
||||
) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
|
||||
|
||||
DROP TABLE `messages`;
|
||||
|
||||
CREATE TABLE `cache_index` (
|
||||
`user_id` int(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||
`mailbox` varchar(255) BINARY NOT NULL,
|
||||
`changed` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
|
||||
`valid` tinyint(1) NOT NULL DEFAULT '0',
|
||||
`data` longtext NOT NULL,
|
||||
CONSTRAINT `user_id_fk_cache_index` FOREIGN KEY (`user_id`)
|
||||
REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
INDEX `changed_index` (`changed`),
|
||||
PRIMARY KEY (`user_id`, `mailbox`)
|
||||
) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
|
||||
|
||||
CREATE TABLE `cache_thread` (
|
||||
`user_id` int(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||
`mailbox` varchar(255) BINARY NOT NULL,
|
||||
`changed` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
|
||||
`data` longtext NOT NULL,
|
||||
CONSTRAINT `user_id_fk_cache_thread` FOREIGN KEY (`user_id`)
|
||||
REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
INDEX `changed_index` (`changed`),
|
||||
PRIMARY KEY (`user_id`, `mailbox`)
|
||||
) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
|
||||
|
||||
CREATE TABLE `cache_messages` (
|
||||
`user_id` int(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||
`mailbox` varchar(255) BINARY NOT NULL,
|
||||
`uid` int(11) UNSIGNED NOT NULL DEFAULT '0',
|
||||
`changed` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
|
||||
`data` longtext NOT NULL,
|
||||
`flags` int(11) NOT NULL DEFAULT '0',
|
||||
CONSTRAINT `user_id_fk_cache_messages` FOREIGN KEY (`user_id`)
|
||||
REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
INDEX `changed_index` (`changed`),
|
||||
PRIMARY KEY (`user_id`, `mailbox`, `uid`)
|
||||
) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
|
||||
|
||||
-- Updates from version 0.7-beta
|
||||
|
||||
ALTER TABLE `session` CHANGE `sess_id` `sess_id` varchar(128) NOT NULL;
|
||||
|
||||
-- Updates from version 0.7
|
||||
|
||||
/*!40014 SET FOREIGN_KEY_CHECKS=0 */;
|
||||
|
||||
ALTER TABLE `contacts` DROP FOREIGN KEY `user_id_fk_contacts`;
|
||||
ALTER TABLE `contacts` DROP INDEX `user_contacts_index`;
|
||||
ALTER TABLE `contacts` MODIFY `email` text NOT NULL;
|
||||
ALTER TABLE `contacts` ADD INDEX `user_contacts_index` (`user_id`,`del`);
|
||||
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 `cache` ALTER `user_id` DROP DEFAULT;
|
||||
ALTER TABLE `cache_index` ALTER `user_id` DROP DEFAULT;
|
||||
ALTER TABLE `cache_thread` ALTER `user_id` DROP DEFAULT;
|
||||
ALTER TABLE `cache_messages` ALTER `user_id` DROP DEFAULT;
|
||||
ALTER TABLE `contacts` ALTER `user_id` DROP DEFAULT;
|
||||
ALTER TABLE `contactgroups` ALTER `user_id` DROP DEFAULT;
|
||||
ALTER TABLE `contactgroupmembers` ALTER `contact_id` DROP DEFAULT;
|
||||
ALTER TABLE `identities` ALTER `user_id` DROP DEFAULT;
|
||||
ALTER TABLE `searches` ALTER `user_id` DROP DEFAULT;
|
||||
|
||||
/*!40014 SET FOREIGN_KEY_CHECKS=1 */;
|
@ -1,16 +0,0 @@
|
||||
-- Updates from version 0.1-stable
|
||||
|
||||
TRUNCATE TABLE `messages`;
|
||||
|
||||
ALTER TABLE `messages`
|
||||
DROP INDEX `idx`,
|
||||
DROP INDEX `uid`;
|
||||
|
||||
ALTER TABLE `cache`
|
||||
DROP INDEX `cache_key`,
|
||||
DROP INDEX `session_id`,
|
||||
ADD INDEX `user_cache_index` (`user_id`,`cache_key`);
|
||||
|
||||
ALTER TABLE `users`
|
||||
ADD INDEX `username_index` (`username`),
|
||||
ADD INDEX `alias_index` (`alias`);
|
@ -1,9 +0,0 @@
|
||||
-- Updates from version 0.1.1
|
||||
|
||||
ALTER TABLE `identities`
|
||||
MODIFY `signature` text,
|
||||
MODIFY `bcc` varchar(128) NOT NULL DEFAULT '',
|
||||
MODIFY `reply-to` varchar(128) NOT NULL DEFAULT '',
|
||||
MODIFY `organization` varchar(128) NOT NULL DEFAULT '',
|
||||
MODIFY `name` varchar(128) NOT NULL,
|
||||
MODIFY `email` varchar(128) NOT NULL;
|
@ -1,4 +0,0 @@
|
||||
-- Updates from version 0.2-alpha
|
||||
|
||||
ALTER TABLE `messages`
|
||||
ADD INDEX `created_index` (`created`);
|
@ -1,20 +0,0 @@
|
||||
-- Updates from version 0.2-beta (InnoDB required)
|
||||
|
||||
ALTER TABLE `cache`
|
||||
DROP `session_id`;
|
||||
|
||||
ALTER TABLE `session`
|
||||
ADD INDEX `changed_index` (`changed`);
|
||||
|
||||
ALTER TABLE `cache`
|
||||
ADD INDEX `created_index` (`created`);
|
||||
|
||||
ALTER TABLE `users`
|
||||
CHANGE `language` `language` varchar(5);
|
||||
|
||||
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;
|
@ -1,12 +0,0 @@
|
||||
-- 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`);
|
@ -1,52 +0,0 @@
|
||||
-- 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 */;
|
@ -1,4 +0,0 @@
|
||||
-- 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';
|
@ -1,8 +0,0 @@
|
||||
-- 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;
|
||||
|
||||
TRUNCATE TABLE `messages`;
|
@ -1,8 +0,0 @@
|
||||
-- Updates from version 0.5.x
|
||||
|
||||
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 `contactgroupmembers` ADD INDEX `contactgroupmembers_contact_index` (`contact_id`);
|
||||
|
||||
TRUNCATE TABLE `messages`;
|
||||
TRUNCATE TABLE `cache`;
|
@ -1,67 +0,0 @@
|
||||
-- Updates from version 0.6
|
||||
|
||||
/*!40014 SET FOREIGN_KEY_CHECKS=0 */;
|
||||
|
||||
ALTER TABLE `users` CHANGE `alias` `alias` varchar(128) BINARY NOT NULL;
|
||||
ALTER TABLE `users` CHANGE `username` `username` varchar(128) BINARY NOT NULL;
|
||||
|
||||
CREATE TABLE `dictionary` (
|
||||
`user_id` int(10) UNSIGNED DEFAULT NULL,
|
||||
`language` varchar(5) NOT NULL,
|
||||
`data` longtext NOT NULL,
|
||||
CONSTRAINT `user_id_fk_dictionary` FOREIGN KEY (`user_id`)
|
||||
REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
UNIQUE `uniqueness` (`user_id`, `language`)
|
||||
) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
|
||||
|
||||
CREATE TABLE `searches` (
|
||||
`search_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`user_id` int(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||
`type` int(3) NOT NULL DEFAULT '0',
|
||||
`name` varchar(128) NOT NULL,
|
||||
`data` text,
|
||||
PRIMARY KEY(`search_id`),
|
||||
CONSTRAINT `user_id_fk_searches` FOREIGN KEY (`user_id`)
|
||||
REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
UNIQUE `uniqueness` (`user_id`, `type`, `name`)
|
||||
) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
|
||||
|
||||
DROP TABLE `messages`;
|
||||
|
||||
CREATE TABLE `cache_index` (
|
||||
`user_id` int(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||
`mailbox` varchar(255) BINARY NOT NULL,
|
||||
`changed` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
|
||||
`valid` tinyint(1) NOT NULL DEFAULT '0',
|
||||
`data` longtext NOT NULL,
|
||||
CONSTRAINT `user_id_fk_cache_index` FOREIGN KEY (`user_id`)
|
||||
REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
INDEX `changed_index` (`changed`),
|
||||
PRIMARY KEY (`user_id`, `mailbox`)
|
||||
) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
|
||||
|
||||
CREATE TABLE `cache_thread` (
|
||||
`user_id` int(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||
`mailbox` varchar(255) BINARY NOT NULL,
|
||||
`changed` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
|
||||
`data` longtext NOT NULL,
|
||||
CONSTRAINT `user_id_fk_cache_thread` FOREIGN KEY (`user_id`)
|
||||
REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
INDEX `changed_index` (`changed`),
|
||||
PRIMARY KEY (`user_id`, `mailbox`)
|
||||
) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
|
||||
|
||||
CREATE TABLE `cache_messages` (
|
||||
`user_id` int(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||
`mailbox` varchar(255) BINARY NOT NULL,
|
||||
`uid` int(11) UNSIGNED NOT NULL DEFAULT '0',
|
||||
`changed` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
|
||||
`data` longtext NOT NULL,
|
||||
`flags` int(11) NOT NULL DEFAULT '0',
|
||||
CONSTRAINT `user_id_fk_cache_messages` FOREIGN KEY (`user_id`)
|
||||
REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
INDEX `changed_index` (`changed`),
|
||||
PRIMARY KEY (`user_id`, `mailbox`, `uid`)
|
||||
) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
|
||||
|
||||
/*!40014 SET FOREIGN_KEY_CHECKS=1 */;
|
@ -1,3 +0,0 @@
|
||||
-- Updates from version 0.7-beta
|
||||
|
||||
ALTER TABLE `session` CHANGE `sess_id` `sess_id` varchar(128) NOT NULL;
|
@ -1,22 +0,0 @@
|
||||
-- Updates from version 0.7
|
||||
|
||||
/*!40014 SET FOREIGN_KEY_CHECKS=0 */;
|
||||
|
||||
ALTER TABLE `contacts` DROP FOREIGN KEY `user_id_fk_contacts`;
|
||||
ALTER TABLE `contacts` DROP INDEX `user_contacts_index`;
|
||||
ALTER TABLE `contacts` MODIFY `email` text NOT NULL;
|
||||
ALTER TABLE `contacts` ADD INDEX `user_contacts_index` (`user_id`,`del`);
|
||||
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 `cache` ALTER `user_id` DROP DEFAULT;
|
||||
ALTER TABLE `cache_index` ALTER `user_id` DROP DEFAULT;
|
||||
ALTER TABLE `cache_thread` ALTER `user_id` DROP DEFAULT;
|
||||
ALTER TABLE `cache_messages` ALTER `user_id` DROP DEFAULT;
|
||||
ALTER TABLE `contacts` ALTER `user_id` DROP DEFAULT;
|
||||
ALTER TABLE `contactgroups` ALTER `user_id` DROP DEFAULT;
|
||||
ALTER TABLE `contactgroupmembers` ALTER `contact_id` DROP DEFAULT;
|
||||
ALTER TABLE `identities` ALTER `user_id` DROP DEFAULT;
|
||||
ALTER TABLE `searches` ALTER `user_id` DROP DEFAULT;
|
||||
|
||||
/*!40014 SET FOREIGN_KEY_CHECKS=1 */;
|
@ -1,5 +0,0 @@
|
||||
-- Updates from version 0.8
|
||||
|
||||
ALTER TABLE `cache` DROP COLUMN `cache_id`;
|
||||
ALTER TABLE `users` DROP COLUMN `alias`;
|
||||
ALTER TABLE `identities` ADD INDEX `email_identities_index` (`email`, `del`);
|
@ -1,7 +0,0 @@
|
||||
-- Upgrade from 0.9-beta
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `system` (
|
||||
`name` varchar(64) NOT NULL,
|
||||
`value` mediumtext,
|
||||
PRIMARY KEY(`name`)
|
||||
) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
|
@ -1 +0,0 @@
|
||||
-- empty
|
@ -1,7 +0,0 @@
|
||||
CREATE TABLE `cache_shared` (
|
||||
`cache_key` varchar(255) /*!40101 CHARACTER SET ascii COLLATE ascii_general_ci */ NOT NULL,
|
||||
`created` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
|
||||
`data` longtext NOT NULL,
|
||||
INDEX `created_index` (`created`),
|
||||
INDEX `cache_key_index` (`cache_key`)
|
||||
) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
|
@ -1,24 +0,0 @@
|
||||
ALTER TABLE `cache` ADD `expires` datetime DEFAULT NULL;
|
||||
ALTER TABLE `cache_shared` ADD `expires` datetime DEFAULT NULL;
|
||||
ALTER TABLE `cache_index` ADD `expires` datetime DEFAULT NULL;
|
||||
ALTER TABLE `cache_thread` ADD `expires` datetime DEFAULT NULL;
|
||||
ALTER TABLE `cache_messages` ADD `expires` datetime DEFAULT NULL;
|
||||
|
||||
-- initialize expires column with created/changed date + 7days
|
||||
UPDATE `cache` SET `expires` = `created` + interval 604800 second;
|
||||
UPDATE `cache_shared` SET `expires` = `created` + interval 604800 second;
|
||||
UPDATE `cache_index` SET `expires` = `changed` + interval 604800 second;
|
||||
UPDATE `cache_thread` SET `expires` = `changed` + interval 604800 second;
|
||||
UPDATE `cache_messages` SET `expires` = `changed` + interval 604800 second;
|
||||
|
||||
ALTER TABLE `cache` DROP INDEX `created_index`;
|
||||
ALTER TABLE `cache_shared` DROP INDEX `created_index`;
|
||||
ALTER TABLE `cache_index` DROP `changed`;
|
||||
ALTER TABLE `cache_thread` DROP `changed`;
|
||||
ALTER TABLE `cache_messages` DROP `changed`;
|
||||
|
||||
ALTER TABLE `cache` ADD INDEX `expires_index` (`expires`);
|
||||
ALTER TABLE `cache_shared` ADD INDEX `expires_index` (`expires`);
|
||||
ALTER TABLE `cache_index` ADD INDEX `expires_index` (`expires`);
|
||||
ALTER TABLE `cache_thread` ADD INDEX `expires_index` (`expires`);
|
||||
ALTER TABLE `cache_messages` ADD INDEX `expires_index` (`expires`);
|
@ -1 +0,0 @@
|
||||
ALTER TABLE `users` CHANGE `preferences` `preferences` longtext;
|
@ -1 +0,0 @@
|
||||
ALTER TABLE `identities` CHANGE `signature` `signature` longtext;
|
@ -1,3 +0,0 @@
|
||||
ALTER TABLE `users`
|
||||
ADD `failed_login` datetime DEFAULT NULL,
|
||||
ADD `failed_login_counter` int(10) UNSIGNED DEFAULT NULL;
|
@ -1 +0,0 @@
|
||||
ALTER TABLE `session` DROP COLUMN `created`;
|
@ -1 +0,0 @@
|
||||
ALTER TABLE `session` MODIFY `ip` varchar(40) NOT NULL;
|
@ -1,24 +0,0 @@
|
||||
ALTER TABLE `dictionary` ADD COLUMN `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST; -- redundant, for compat. with Galera Cluster
|
||||
|
||||
DROP TABLE `cache`;
|
||||
DROP TABLE `cache_shared`;
|
||||
|
||||
CREATE TABLE `cache` (
|
||||
`user_id` int(10) UNSIGNED NOT NULL,
|
||||
`cache_key` varchar(128) /*!40101 CHARACTER SET ascii COLLATE ascii_general_ci */ NOT NULL,
|
||||
`expires` datetime DEFAULT NULL,
|
||||
`data` longtext NOT NULL,
|
||||
PRIMARY KEY (`user_id`, `cache_key`),
|
||||
CONSTRAINT `user_id_fk_cache` FOREIGN KEY (`user_id`)
|
||||
REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
INDEX `expires_index` (`expires`)
|
||||
) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
|
||||
|
||||
|
||||
CREATE TABLE `cache_shared` (
|
||||
`cache_key` varchar(255) /*!40101 CHARACTER SET ascii COLLATE ascii_general_ci */ NOT NULL,
|
||||
`expires` datetime DEFAULT NULL,
|
||||
`data` longtext NOT NULL,
|
||||
PRIMARY KEY (`cache_key`),
|
||||
INDEX `expires_index` (`expires`)
|
||||
) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
|
@ -1,11 +0,0 @@
|
||||
CREATE TABLE `filestore` (
|
||||
`file_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`user_id` int(10) UNSIGNED NOT NULL,
|
||||
`filename` varchar(128) NOT NULL,
|
||||
`mtime` int(10) NOT NULL,
|
||||
`data` longtext NOT NULL,
|
||||
PRIMARY KEY (`file_id`),
|
||||
CONSTRAINT `user_id_fk_filestore` FOREIGN KEY (`user_id`)
|
||||
REFERENCES `users` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
UNIQUE `uniqueness` (`user_id`, `filename`)
|
||||
) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
|
@ -1,7 +0,0 @@
|
||||
ALTER TABLE `filestore` ADD COLUMN `context` varchar(32) NOT NULL;
|
||||
UPDATE `filestore` SET `context` = 'enigma';
|
||||
ALTER TABLE `filestore` DROP FOREIGN KEY `user_id_fk_filestore`;
|
||||
ALTER TABLE `filestore` DROP INDEX `uniqueness`;
|
||||
ALTER TABLE `filestore` ADD UNIQUE INDEX `uniqueness` (`user_id`, `context`, `filename`);
|
||||
ALTER TABLE `filestore` ADD CONSTRAINT `user_id_fk_filestore` FOREIGN KEY (`user_id`)
|
||||
REFERENCES `users` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE;
|
@ -1,2 +0,0 @@
|
||||
ALTER TABLE `cache` CHANGE `cache_key` `cache_key` varchar(128) BINARY NOT NULL;
|
||||
ALTER TABLE `cache_shared` CHANGE `cache_key` `cache_key` varchar(255) BINARY NOT NULL;
|
@ -1,2 +0,0 @@
|
||||
ALTER TABLE `users` MODIFY `language` varchar(16);
|
||||
ALTER TABLE `dictionary` MODIFY `language` varchar(16) NOT NULL;
|
@ -1,21 +0,0 @@
|
||||
ALTER TABLE `session` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
||||
ALTER TABLE `users` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
||||
ALTER TABLE `cache` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
||||
ALTER TABLE `cache_shared` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
||||
ALTER TABLE `cache_index` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
||||
ALTER TABLE `cache_thread` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
||||
ALTER TABLE `cache_messages` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
||||
ALTER TABLE `contacts` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
||||
ALTER TABLE `contactgroups` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
||||
ALTER TABLE `identities` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
||||
ALTER TABLE `dictionary` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
||||
ALTER TABLE `searches` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
||||
ALTER TABLE `filestore` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
||||
ALTER TABLE `system` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
||||
|
||||
ALTER TABLE `users` CHANGE `username` `username` varchar(128) BINARY NOT NULL;
|
||||
ALTER TABLE `cache` CHANGE `cache_key` `cache_key` varchar(128) BINARY NOT NULL;
|
||||
ALTER TABLE `cache_shared` CHANGE `cache_key` `cache_key` varchar(255) BINARY NOT NULL;
|
||||
ALTER TABLE `cache_index` CHANGE `mailbox` `mailbox` varchar(255) BINARY NOT NULL;
|
||||
ALTER TABLE `cache_thread` CHANGE `mailbox` `mailbox` varchar(255) BINARY NOT NULL;
|
||||
ALTER TABLE `cache_messages` CHANGE `mailbox` `mailbox` varchar(255) BINARY NOT NULL;
|
@ -1,241 +0,0 @@
|
||||
-- Roundcube Webmail initial database structure
|
||||
-- This was tested with Oracle 11g
|
||||
|
||||
CREATE TABLE "users" (
|
||||
"user_id" integer PRIMARY KEY,
|
||||
"username" varchar(128) NOT NULL,
|
||||
"mail_host" varchar(128) NOT NULL,
|
||||
"created" timestamp with time zone DEFAULT current_timestamp NOT NULL,
|
||||
"last_login" timestamp with time zone DEFAULT NULL,
|
||||
"failed_login" timestamp with time zone DEFAULT NULL,
|
||||
"failed_login_counter" integer DEFAULT NULL,
|
||||
"language" varchar(16),
|
||||
"preferences" long DEFAULT NULL,
|
||||
CONSTRAINT "users_username_key" UNIQUE ("username", "mail_host")
|
||||
);
|
||||
|
||||
CREATE SEQUENCE "users_seq"
|
||||
START WITH 1 INCREMENT BY 1 NOMAXVALUE;
|
||||
|
||||
CREATE TRIGGER "users_seq_trig"
|
||||
BEFORE INSERT ON "users" FOR EACH ROW
|
||||
BEGIN
|
||||
:NEW."user_id" := "users_seq".nextval;
|
||||
END;
|
||||
/
|
||||
|
||||
CREATE TABLE "session" (
|
||||
"sess_id" varchar(128) NOT NULL PRIMARY KEY,
|
||||
"changed" timestamp with time zone DEFAULT current_timestamp NOT NULL,
|
||||
"ip" varchar(41) NOT NULL,
|
||||
"vars" long NOT NULL
|
||||
);
|
||||
|
||||
CREATE INDEX "session_changed_idx" ON "session" ("changed");
|
||||
|
||||
|
||||
CREATE TABLE "identities" (
|
||||
"identity_id" integer PRIMARY KEY,
|
||||
"user_id" integer NOT NULL
|
||||
REFERENCES "users" ("user_id") ON DELETE CASCADE,
|
||||
"changed" timestamp with time zone DEFAULT current_timestamp NOT NULL,
|
||||
"del" smallint DEFAULT 0 NOT NULL,
|
||||
"standard" smallint DEFAULT 0 NOT NULL,
|
||||
"name" varchar(128) NOT NULL,
|
||||
"organization" varchar(128),
|
||||
"email" varchar(128) NOT NULL,
|
||||
"reply-to" varchar(128),
|
||||
"bcc" varchar(128),
|
||||
"signature" long,
|
||||
"html_signature" integer DEFAULT 0 NOT NULL
|
||||
);
|
||||
|
||||
CREATE INDEX "identities_user_id_idx" ON "identities" ("user_id", "del");
|
||||
CREATE INDEX "identities_email_idx" ON "identities" ("email", "del");
|
||||
|
||||
CREATE SEQUENCE "identities_seq"
|
||||
START WITH 1 INCREMENT BY 1 NOMAXVALUE;
|
||||
|
||||
CREATE TRIGGER "identities_seq_trig"
|
||||
BEFORE INSERT ON "identities" FOR EACH ROW
|
||||
BEGIN
|
||||
:NEW."identity_id" := "identities_seq".nextval;
|
||||
END;
|
||||
/
|
||||
|
||||
CREATE TABLE "contacts" (
|
||||
"contact_id" integer PRIMARY KEY,
|
||||
"user_id" integer NOT NULL
|
||||
REFERENCES "users" ("user_id") ON DELETE CASCADE,
|
||||
"changed" timestamp with time zone DEFAULT current_timestamp NOT NULL,
|
||||
"del" smallint DEFAULT 0 NOT NULL,
|
||||
"name" varchar(128) DEFAULT NULL,
|
||||
"email" varchar(4000) DEFAULT NULL,
|
||||
"firstname" varchar(128) DEFAULT NULL,
|
||||
"surname" varchar(128) DEFAULT NULL,
|
||||
"vcard" long,
|
||||
"words" varchar(4000)
|
||||
);
|
||||
|
||||
CREATE INDEX "contacts_user_id_idx" ON "contacts" ("user_id", "del");
|
||||
|
||||
CREATE SEQUENCE "contacts_seq"
|
||||
START WITH 1 INCREMENT BY 1 NOMAXVALUE;
|
||||
|
||||
CREATE TRIGGER "contacts_seq_trig"
|
||||
BEFORE INSERT ON "contacts" FOR EACH ROW
|
||||
BEGIN
|
||||
:NEW."contact_id" := "contacts_seq".nextval;
|
||||
END;
|
||||
/
|
||||
|
||||
CREATE TABLE "contactgroups" (
|
||||
"contactgroup_id" integer PRIMARY KEY,
|
||||
"user_id" integer NOT NULL
|
||||
REFERENCES "users" ("user_id") ON DELETE CASCADE,
|
||||
"changed" timestamp with time zone DEFAULT current_timestamp NOT NULL,
|
||||
"del" smallint DEFAULT 0 NOT NULL,
|
||||
"name" varchar(128) NOT NULL
|
||||
);
|
||||
|
||||
CREATE INDEX "contactgroups_user_id_idx" ON "contactgroups" ("user_id", "del");
|
||||
|
||||
CREATE SEQUENCE "contactgroups_seq"
|
||||
START WITH 1 INCREMENT BY 1 NOMAXVALUE;
|
||||
|
||||
CREATE TRIGGER "contactgroups_seq_trig"
|
||||
BEFORE INSERT ON "contactgroups" FOR EACH ROW
|
||||
BEGIN
|
||||
:NEW."contactgroup_id" := "contactgroups_seq".nextval;
|
||||
END;
|
||||
/
|
||||
|
||||
CREATE TABLE "contactgroupmembers" (
|
||||
"contactgroup_id" integer NOT NULL
|
||||
REFERENCES "contactgroups" ("contactgroup_id") ON DELETE CASCADE,
|
||||
"contact_id" integer NOT NULL
|
||||
REFERENCES "contacts" ("contact_id") ON DELETE CASCADE,
|
||||
"created" timestamp with time zone DEFAULT current_timestamp NOT NULL,
|
||||
PRIMARY KEY ("contactgroup_id", "contact_id")
|
||||
);
|
||||
|
||||
CREATE INDEX "contactgroupmembers_idx" ON "contactgroupmembers" ("contact_id");
|
||||
|
||||
|
||||
CREATE TABLE "cache" (
|
||||
"user_id" integer NOT NULL
|
||||
REFERENCES "users" ("user_id") ON DELETE CASCADE,
|
||||
"cache_key" varchar(128) NOT NULL,
|
||||
"expires" timestamp with time zone DEFAULT NULL,
|
||||
"data" long NOT NULL,
|
||||
PRIMARY KEY ("user_id", "cache_key")
|
||||
);
|
||||
|
||||
CREATE INDEX "cache_expires_idx" ON "cache" ("expires");
|
||||
|
||||
|
||||
CREATE TABLE "cache_shared" (
|
||||
"cache_key" varchar(255) NOT NULL,
|
||||
"expires" timestamp with time zone DEFAULT NULL,
|
||||
"data" long NOT NULL,
|
||||
PRIMARY KEY ("cache_key")
|
||||
);
|
||||
|
||||
CREATE INDEX "cache_shared_expires_idx" ON "cache_shared" ("expires");
|
||||
|
||||
|
||||
CREATE TABLE "cache_index" (
|
||||
"user_id" integer NOT NULL
|
||||
REFERENCES "users" ("user_id") ON DELETE CASCADE,
|
||||
"mailbox" varchar(255) NOT NULL,
|
||||
"expires" timestamp with time zone DEFAULT NULL,
|
||||
"valid" smallint DEFAULT 0 NOT NULL,
|
||||
"data" long NOT NULL,
|
||||
PRIMARY KEY ("user_id", "mailbox")
|
||||
);
|
||||
|
||||
CREATE INDEX "cache_index_expires_idx" ON "cache_index" ("expires");
|
||||
|
||||
|
||||
CREATE TABLE "cache_thread" (
|
||||
"user_id" integer NOT NULL
|
||||
REFERENCES "users" ("user_id") ON DELETE CASCADE,
|
||||
"mailbox" varchar(255) NOT NULL,
|
||||
"expires" timestamp with time zone DEFAULT NULL,
|
||||
"data" long NOT NULL,
|
||||
PRIMARY KEY ("user_id", "mailbox")
|
||||
);
|
||||
|
||||
CREATE INDEX "cache_thread_expires_idx" ON "cache_thread" ("expires");
|
||||
|
||||
|
||||
CREATE TABLE "cache_messages" (
|
||||
"user_id" integer NOT NULL
|
||||
REFERENCES "users" ("user_id") ON DELETE CASCADE,
|
||||
"mailbox" varchar(255) NOT NULL,
|
||||
"uid" integer NOT NULL,
|
||||
"expires" timestamp with time zone DEFAULT NULL,
|
||||
"data" long NOT NULL,
|
||||
"flags" integer DEFAULT 0 NOT NULL,
|
||||
PRIMARY KEY ("user_id", "mailbox", "uid")
|
||||
);
|
||||
|
||||
CREATE INDEX "cache_messages_expires_idx" ON "cache_messages" ("expires");
|
||||
|
||||
|
||||
CREATE TABLE "dictionary" (
|
||||
"user_id" integer DEFAULT NULL
|
||||
REFERENCES "users" ("user_id") ON DELETE CASCADE,
|
||||
"language" varchar(16) NOT NULL,
|
||||
"data" long DEFAULT NULL,
|
||||
CONSTRAINT "dictionary_user_id_lang_key" UNIQUE ("user_id", "language")
|
||||
);
|
||||
|
||||
|
||||
CREATE TABLE "searches" (
|
||||
"search_id" integer PRIMARY KEY,
|
||||
"user_id" integer NOT NULL
|
||||
REFERENCES "users" ("user_id") ON DELETE CASCADE,
|
||||
"type" smallint DEFAULT 0 NOT NULL,
|
||||
"name" varchar(128) NOT NULL,
|
||||
"data" long NOT NULL,
|
||||
CONSTRAINT "searches_user_id_key" UNIQUE ("user_id", "type", "name")
|
||||
);
|
||||
|
||||
CREATE SEQUENCE "searches_seq"
|
||||
START WITH 1 INCREMENT BY 1 NOMAXVALUE;
|
||||
|
||||
CREATE TRIGGER "searches_seq_trig"
|
||||
BEFORE INSERT ON "searches" FOR EACH ROW
|
||||
BEGIN
|
||||
:NEW."search_id" := "searches_seq".nextval;
|
||||
END;
|
||||
/
|
||||
|
||||
CREATE TABLE "filestore" (
|
||||
"file_id" integer PRIMARY KEY,
|
||||
"user_id" integer NOT NULL
|
||||
REFERENCES "users" ("user_id") ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
"context" varchar(32) NOT NULL,
|
||||
"filename" varchar(128) NOT NULL,
|
||||
"mtime" integer NOT NULL,
|
||||
"data" long,
|
||||
CONSTRAINT "filestore_user_id_key" UNIQUE ("user_id", "context", "filename")
|
||||
);
|
||||
|
||||
CREATE SEQUENCE "filestore_seq"
|
||||
START WITH 1 INCREMENT BY 1 NOMAXVALUE;
|
||||
|
||||
CREATE TRIGGER "filestore_seq_trig"
|
||||
BEFORE INSERT ON "filestore" FOR EACH ROW
|
||||
BEGIN
|
||||
:NEW."user_id" := "filestore_seq".nextval;
|
||||
END;
|
||||
/
|
||||
|
||||
CREATE TABLE "system" (
|
||||
"name" varchar(64) NOT NULL PRIMARY KEY,
|
||||
"value" long
|
||||
);
|
||||
|
||||
INSERT INTO "system" ("name", "value") VALUES ('roundcube-version', '2020020101');
|
@ -1 +0,0 @@
|
||||
-- empty
|
@ -1,2 +0,0 @@
|
||||
ALTER TABLE "users" ADD "failed_login" timestamp with time zone DEFAULT NULL;
|
||||
ALTER TABLE "users" ADD "failed_login_counter" integer DEFAULT NULL;
|
@ -1 +0,0 @@
|
||||
ALTER TABLE "session" DROP COLUMN "created";
|
@ -1 +0,0 @@
|
||||
ALTER TABLE "session" MODIFY "ip" varchar(41) NOT NULL;
|
@ -1,23 +0,0 @@
|
||||
DROP TABLE "cache";
|
||||
DROP TABLE "cache_shared";
|
||||
|
||||
CREATE TABLE "cache" (
|
||||
"user_id" integer NOT NULL
|
||||
REFERENCES "users" ("user_id") ON DELETE CASCADE,
|
||||
"cache_key" varchar(128) NOT NULL,
|
||||
"expires" timestamp with time zone DEFAULT NULL,
|
||||
"data" long NOT NULL,
|
||||
PRIMARY KEY ("user_id", "cache_key")
|
||||
);
|
||||
|
||||
CREATE INDEX "cache_expires_idx" ON "cache" ("expires");
|
||||
|
||||
|
||||
CREATE TABLE "cache_shared" (
|
||||
"cache_key" varchar(255) NOT NULL,
|
||||
"expires" timestamp with time zone DEFAULT NULL,
|
||||
"data" long NOT NULL,
|
||||
PRIMARY KEY ("cache_key")
|
||||
);
|
||||
|
||||
CREATE INDEX "cache_shared_expires_idx" ON "cache_shared" ("expires");
|
@ -1,19 +0,0 @@
|
||||
CREATE TABLE "filestore" (
|
||||
"file_id" integer PRIMARY KEY,
|
||||
"user_id" integer NOT NULL
|
||||
REFERENCES "users" ("user_id") ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
"filename" varchar(128) NOT NULL,
|
||||
"mtime" integer NOT NULL,
|
||||
"data" long,
|
||||
CONSTRAINT "filestore_user_id_key" UNIQUE ("user_id", "filename")
|
||||
);
|
||||
|
||||
CREATE SEQUENCE "filestore_seq"
|
||||
START WITH 1 INCREMENT BY 1 NOMAXVALUE;
|
||||
|
||||
CREATE TRIGGER "filestore_seq_trig"
|
||||
BEFORE INSERT ON "filestore" FOR EACH ROW
|
||||
BEGIN
|
||||
:NEW."user_id" := "filestore_seq".nextval;
|
||||
END;
|
||||
/
|
@ -1,4 +0,0 @@
|
||||
ALTER TABLE "filestore" ADD COLUMN "context" varchar(32) NOT NULL;
|
||||
UPDATE "filestore" SET "context" = 'enigma';
|
||||
ALTER TABLE "filestore" DROP CONSTRAINT "filestore_user_id_key";
|
||||
ALTER TABLE "filestore" ADD CONSTRAINT "filestore_user_id_key" UNIQUE ("user_id", "context", "filename");
|
@ -1 +0,0 @@
|
||||
-- empty
|
@ -1,2 +0,0 @@
|
||||
ALTER TABLE "users" MODIFY "language" varchar(16) NOT NULL;
|
||||
ALTER TABLE "dictionary" MODIFY "language" varchar(16);
|
@ -1 +0,0 @@
|
||||
-- empty
|
@ -0,0 +1,177 @@
|
||||
-- Roundcube Webmail update script for Postgres databases
|
||||
-- Updates from version 0.1-stable to 0.1.1
|
||||
|
||||
CREATE INDEX cache_user_id_idx ON cache (user_id, cache_key);
|
||||
CREATE INDEX contacts_user_id_idx ON contacts (user_id);
|
||||
CREATE INDEX identities_user_id_idx ON identities (user_id);
|
||||
|
||||
CREATE INDEX users_username_id_idx ON users (username);
|
||||
CREATE INDEX users_alias_id_idx ON users (alias);
|
||||
|
||||
-- added ON DELETE/UPDATE actions
|
||||
ALTER TABLE messages DROP CONSTRAINT messages_user_id_fkey;
|
||||
ALTER TABLE messages ADD FOREIGN KEY (user_id) REFERENCES users(user_id) ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
ALTER TABLE identities DROP CONSTRAINT identities_user_id_fkey;
|
||||
ALTER TABLE identities ADD FOREIGN KEY (user_id) REFERENCES users(user_id) ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
ALTER TABLE contacts DROP CONSTRAINT contacts_user_id_fkey;
|
||||
ALTER TABLE contacts ADD FOREIGN KEY (user_id) REFERENCES users(user_id) ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
ALTER TABLE cache DROP CONSTRAINT cache_user_id_fkey;
|
||||
ALTER TABLE cache ADD FOREIGN KEY (user_id) REFERENCES users(user_id) ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
|
||||
-- Updates from version 0.2-alpha
|
||||
|
||||
CREATE INDEX messages_created_idx ON messages (created);
|
||||
|
||||
-- Updates from version 0.2-beta
|
||||
|
||||
ALTER TABLE cache DROP session_id;
|
||||
|
||||
CREATE INDEX session_changed_idx ON session (changed);
|
||||
CREATE INDEX cache_created_idx ON "cache" (created);
|
||||
|
||||
ALTER TABLE users ALTER "language" DROP NOT NULL;
|
||||
ALTER TABLE users ALTER "language" DROP DEFAULT;
|
||||
|
||||
ALTER TABLE identities ALTER del TYPE smallint;
|
||||
ALTER TABLE identities ALTER standard TYPE smallint;
|
||||
ALTER TABLE contacts ALTER del TYPE smallint;
|
||||
ALTER TABLE messages ALTER del TYPE smallint;
|
||||
|
||||
-- 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 CONSTRAINT users_username_key UNIQUE (username, mail_host);
|
||||
ALTER TABLE contacts ALTER email TYPE varchar(255);
|
||||
|
||||
TRUNCATE messages;
|
||||
|
||||
-- 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;
|
||||
CREATE INDEX contactgroupmembers_contact_id_idx ON contactgroupmembers (contact_id);
|
||||
|
||||
TRUNCATE messages;
|
||||
TRUNCATE cache;
|
||||
|
||||
-- Updates from version 0.6
|
||||
|
||||
CREATE TABLE dictionary (
|
||||
user_id integer DEFAULT NULL
|
||||
REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
"language" varchar(5) NOT NULL,
|
||||
data text NOT NULL,
|
||||
CONSTRAINT dictionary_user_id_language_key UNIQUE (user_id, "language")
|
||||
);
|
||||
|
||||
CREATE SEQUENCE search_ids
|
||||
INCREMENT BY 1
|
||||
NO MAXVALUE
|
||||
NO MINVALUE
|
||||
CACHE 1;
|
||||
|
||||
CREATE TABLE searches (
|
||||
search_id integer DEFAULT nextval('search_ids'::text) PRIMARY KEY,
|
||||
user_id integer NOT NULL
|
||||
REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
"type" smallint DEFAULT 0 NOT NULL,
|
||||
name varchar(128) NOT NULL,
|
||||
data text NOT NULL,
|
||||
CONSTRAINT searches_user_id_key UNIQUE (user_id, "type", name)
|
||||
);
|
||||
|
||||
DROP SEQUENCE message_ids;
|
||||
DROP TABLE messages;
|
||||
|
||||
CREATE TABLE cache_index (
|
||||
user_id integer NOT NULL
|
||||
REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
mailbox varchar(255) NOT NULL,
|
||||
changed timestamp with time zone DEFAULT now() NOT NULL,
|
||||
valid smallint NOT NULL DEFAULT 0,
|
||||
data text NOT NULL,
|
||||
PRIMARY KEY (user_id, mailbox)
|
||||
);
|
||||
|
||||
CREATE INDEX cache_index_changed_idx ON cache_index (changed);
|
||||
|
||||
CREATE TABLE cache_thread (
|
||||
user_id integer NOT NULL
|
||||
REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
mailbox varchar(255) NOT NULL,
|
||||
changed timestamp with time zone DEFAULT now() NOT NULL,
|
||||
data text NOT NULL,
|
||||
PRIMARY KEY (user_id, mailbox)
|
||||
);
|
||||
|
||||
CREATE INDEX cache_thread_changed_idx ON cache_thread (changed);
|
||||
|
||||
CREATE TABLE cache_messages (
|
||||
user_id integer NOT NULL
|
||||
REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
mailbox varchar(255) NOT NULL,
|
||||
uid integer NOT NULL,
|
||||
changed timestamp with time zone DEFAULT now() NOT NULL,
|
||||
data text NOT NULL,
|
||||
flags integer NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (user_id, mailbox, uid)
|
||||
);
|
||||
|
||||
CREATE INDEX cache_messages_changed_idx ON cache_messages (changed);
|
||||
|
||||
-- Updates from version 0.7-beta
|
||||
|
||||
ALTER TABLE "session" ALTER sess_id TYPE varchar(128);
|
||||
|
||||
-- Updates from version 0.7
|
||||
|
||||
DROP INDEX contacts_user_id_idx;
|
||||
CREATE INDEX contacts_user_id_idx ON contacts USING btree (user_id, del);
|
||||
ALTER TABLE contacts ALTER email TYPE text;
|
@ -1,18 +0,0 @@
|
||||
-- Updates from version 0.1-stable to 0.1.1
|
||||
|
||||
CREATE INDEX cache_user_id_idx ON cache (user_id, cache_key);
|
||||
CREATE INDEX contacts_user_id_idx ON contacts (user_id);
|
||||
CREATE INDEX identities_user_id_idx ON identities (user_id);
|
||||
|
||||
CREATE INDEX users_username_id_idx ON users (username);
|
||||
CREATE INDEX users_alias_id_idx ON users (alias);
|
||||
|
||||
-- added ON DELETE/UPDATE actions
|
||||
ALTER TABLE messages DROP CONSTRAINT messages_user_id_fkey;
|
||||
ALTER TABLE messages ADD FOREIGN KEY (user_id) REFERENCES users(user_id) ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
ALTER TABLE identities DROP CONSTRAINT identities_user_id_fkey;
|
||||
ALTER TABLE identities ADD FOREIGN KEY (user_id) REFERENCES users(user_id) ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
ALTER TABLE contacts DROP CONSTRAINT contacts_user_id_fkey;
|
||||
ALTER TABLE contacts ADD FOREIGN KEY (user_id) REFERENCES users(user_id) ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
ALTER TABLE cache DROP CONSTRAINT cache_user_id_fkey;
|
||||
ALTER TABLE cache ADD FOREIGN KEY (user_id) REFERENCES users(user_id) ON DELETE CASCADE ON UPDATE CASCADE;
|
@ -1,3 +0,0 @@
|
||||
-- Updates from version 0.2-alpha
|
||||
|
||||
CREATE INDEX messages_created_idx ON messages (created);
|
@ -1,14 +0,0 @@
|
||||
-- Updates from version 0.2-beta
|
||||
|
||||
ALTER TABLE cache DROP session_id;
|
||||
|
||||
CREATE INDEX session_changed_idx ON session (changed);
|
||||
CREATE INDEX cache_created_idx ON "cache" (created);
|
||||
|
||||
ALTER TABLE users ALTER "language" DROP NOT NULL;
|
||||
ALTER TABLE users ALTER "language" DROP DEFAULT;
|
||||
|
||||
ALTER TABLE identities ALTER del TYPE smallint;
|
||||
ALTER TABLE identities ALTER standard TYPE smallint;
|
||||
ALTER TABLE contacts ALTER del TYPE smallint;
|
||||
ALTER TABLE messages ALTER del TYPE smallint;
|
@ -1,6 +0,0 @@
|
||||
-- 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);
|
@ -1,32 +0,0 @@
|
||||
-- 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)
|
||||
);
|
@ -1,4 +0,0 @@
|
||||
-- Updates from version 0.4-beta
|
||||
|
||||
ALTER TABLE users ALTER last_login DROP NOT NULL;
|
||||
ALTER TABLE users ALTER last_login SET DEFAULT NULL;
|
@ -1,7 +0,0 @@
|
||||
-- Updates from version 0.4.2
|
||||
|
||||
DROP INDEX users_username_id_idx;
|
||||
ALTER TABLE users ADD CONSTRAINT users_username_key UNIQUE (username, mail_host);
|
||||
ALTER TABLE contacts ALTER email TYPE varchar(255);
|
||||
|
||||
TRUNCATE messages;
|
@ -1,7 +0,0 @@
|
||||
-- Updates from version 0.5.x
|
||||
|
||||
ALTER TABLE contacts ADD words TEXT NULL;
|
||||
CREATE INDEX contactgroupmembers_contact_id_idx ON contactgroupmembers (contact_id);
|
||||
|
||||
TRUNCATE messages;
|
||||
TRUNCATE cache;
|
@ -1,64 +0,0 @@
|
||||
-- Updates from version 0.6
|
||||
|
||||
CREATE TABLE dictionary (
|
||||
user_id integer DEFAULT NULL
|
||||
REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
"language" varchar(5) NOT NULL,
|
||||
data text NOT NULL,
|
||||
CONSTRAINT dictionary_user_id_language_key UNIQUE (user_id, "language")
|
||||
);
|
||||
|
||||
CREATE SEQUENCE search_ids
|
||||
INCREMENT BY 1
|
||||
NO MAXVALUE
|
||||
NO MINVALUE
|
||||
CACHE 1;
|
||||
|
||||
CREATE TABLE searches (
|
||||
search_id integer DEFAULT nextval('search_ids'::text) PRIMARY KEY,
|
||||
user_id integer NOT NULL
|
||||
REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
"type" smallint DEFAULT 0 NOT NULL,
|
||||
name varchar(128) NOT NULL,
|
||||
data text NOT NULL,
|
||||
CONSTRAINT searches_user_id_key UNIQUE (user_id, "type", name)
|
||||
);
|
||||
|
||||
DROP SEQUENCE message_ids;
|
||||
DROP TABLE messages;
|
||||
|
||||
CREATE TABLE cache_index (
|
||||
user_id integer NOT NULL
|
||||
REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
mailbox varchar(255) NOT NULL,
|
||||
changed timestamp with time zone DEFAULT now() NOT NULL,
|
||||
valid smallint NOT NULL DEFAULT 0,
|
||||
data text NOT NULL,
|
||||
PRIMARY KEY (user_id, mailbox)
|
||||
);
|
||||
|
||||
CREATE INDEX cache_index_changed_idx ON cache_index (changed);
|
||||
|
||||
CREATE TABLE cache_thread (
|
||||
user_id integer NOT NULL
|
||||
REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
mailbox varchar(255) NOT NULL,
|
||||
changed timestamp with time zone DEFAULT now() NOT NULL,
|
||||
data text NOT NULL,
|
||||
PRIMARY KEY (user_id, mailbox)
|
||||
);
|
||||
|
||||
CREATE INDEX cache_thread_changed_idx ON cache_thread (changed);
|
||||
|
||||
CREATE TABLE cache_messages (
|
||||
user_id integer NOT NULL
|
||||
REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
mailbox varchar(255) NOT NULL,
|
||||
uid integer NOT NULL,
|
||||
changed timestamp with time zone DEFAULT now() NOT NULL,
|
||||
data text NOT NULL,
|
||||
flags integer NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (user_id, mailbox, uid)
|
||||
);
|
||||
|
||||
CREATE INDEX cache_messages_changed_idx ON cache_messages (changed);
|
@ -1,3 +0,0 @@
|
||||
-- Updates from version 0.7-beta
|
||||
|
||||
ALTER TABLE "session" ALTER sess_id TYPE varchar(128);
|
@ -1,5 +0,0 @@
|
||||
-- Updates from version 0.7
|
||||
|
||||
DROP INDEX contacts_user_id_idx;
|
||||
CREATE INDEX contacts_user_id_idx ON contacts USING btree (user_id, del);
|
||||
ALTER TABLE contacts ALTER email TYPE text;
|
@ -1,7 +0,0 @@
|
||||
-- Updates from version 0.8
|
||||
|
||||
ALTER TABLE cache DROP COLUMN cache_id;
|
||||
DROP SEQUENCE cache_ids;
|
||||
|
||||
ALTER TABLE users DROP COLUMN alias;
|
||||
CREATE INDEX identities_email_idx ON identities (email, del);
|
@ -1,4 +0,0 @@
|
||||
CREATE TABLE "system" (
|
||||
name varchar(64) NOT NULL PRIMARY KEY,
|
||||
value text
|
||||
);
|
@ -1,14 +0,0 @@
|
||||
ALTER SEQUENCE user_ids RENAME TO users_seq;
|
||||
ALTER TABLE users ALTER COLUMN user_id SET DEFAULT nextval('users_seq'::text);
|
||||
|
||||
ALTER SEQUENCE identity_ids RENAME TO identities_seq;
|
||||
ALTER TABLE identities ALTER COLUMN identity_id SET DEFAULT nextval('identities_seq'::text);
|
||||
|
||||
ALTER SEQUENCE contact_ids RENAME TO contacts_seq;
|
||||
ALTER TABLE contacts ALTER COLUMN contact_id SET DEFAULT nextval('contacts_seq'::text);
|
||||
|
||||
ALTER SEQUENCE contactgroups_ids RENAME TO contactgroups_seq;
|
||||
ALTER TABLE contactgroups ALTER COLUMN contactgroup_id SET DEFAULT nextval('contactgroups_seq'::text);
|
||||
|
||||
ALTER SEQUENCE search_ids RENAME TO searches_seq;
|
||||
ALTER TABLE searches ALTER COLUMN search_id SET DEFAULT nextval('searches_seq'::text);
|
@ -1,8 +0,0 @@
|
||||
CREATE TABLE "cache_shared" (
|
||||
cache_key varchar(255) NOT NULL,
|
||||
created timestamp with time zone DEFAULT now() NOT NULL,
|
||||
data text NOT NULL
|
||||
);
|
||||
|
||||
CREATE INDEX cache_shared_cache_key_idx ON "cache_shared" (cache_key);
|
||||
CREATE INDEX cache_shared_created_idx ON "cache_shared" (created);
|
@ -1,24 +0,0 @@
|
||||
ALTER TABLE "cache" ADD expires timestamp with time zone DEFAULT NULL;
|
||||
ALTER TABLE "cache_shared" ADD expires timestamp with time zone DEFAULT NULL;
|
||||
ALTER TABLE "cache_index" ADD expires timestamp with time zone DEFAULT NULL;
|
||||
ALTER TABLE "cache_thread" ADD expires timestamp with time zone DEFAULT NULL;
|
||||
ALTER TABLE "cache_messages" ADD expires timestamp with time zone DEFAULT NULL;
|
||||
|
||||
-- initialize expires column with created/changed date + 7days
|
||||
UPDATE "cache" SET expires = created + interval '604800 seconds';
|
||||
UPDATE "cache_shared" SET expires = created + interval '604800 seconds';
|
||||
UPDATE "cache_index" SET expires = changed + interval '604800 seconds';
|
||||
UPDATE "cache_thread" SET expires = changed + interval '604800 seconds';
|
||||
UPDATE "cache_messages" SET expires = changed + interval '604800 seconds';
|
||||
|
||||
DROP INDEX cache_created_idx;
|
||||
DROP INDEX cache_shared_created_idx;
|
||||
ALTER TABLE "cache_index" DROP "changed";
|
||||
ALTER TABLE "cache_thread" DROP "changed";
|
||||
ALTER TABLE "cache_messages" DROP "changed";
|
||||
|
||||
CREATE INDEX cache_expires_idx ON "cache" (expires);
|
||||
CREATE INDEX cache_shared_expires_idx ON "cache_shared" (expires);
|
||||
CREATE INDEX cache_index_expires_idx ON "cache_index" (expires);
|
||||
CREATE INDEX cache_thread_expires_idx ON "cache_thread" (expires);
|
||||
CREATE INDEX cache_messages_expires_idx ON "cache_messages" (expires);
|
@ -1 +0,0 @@
|
||||
-- empty
|
@ -1 +0,0 @@
|
||||
-- empty
|
@ -1,2 +0,0 @@
|
||||
ALTER TABLE "users" ADD failed_login timestamp with time zone DEFAULT NULL;
|
||||
ALTER TABLE "users" ADD failed_login_counter integer DEFAULT NULL;
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue