From 23362230b59e89c63743c8d174f0fe11533e59b2 Mon Sep 17 00:00:00 2001
From: thomascube <thomas@roundcube.net>
Date: Tue, 20 Apr 2010 03:26:11 -0400
Subject: [PATCH] Replace ALTER TABLE statement in Sqlite schema update script; more precise instructions for db updates and about new cleaning script

---
 INSTALL               |   20 +++++++---
 README                |   22 +++++-----
 SQL/sqlite.update.sql |   44 ++++++++++++++++++++-
 installer/test.php    |    3 +
 4 files changed, 68 insertions(+), 21 deletions(-)

diff --git a/INSTALL b/INSTALL
index 2664e7f..be5a0e9 100644
--- a/INSTALL
+++ b/INSTALL
@@ -52,7 +52,7 @@
 CONFIGURATION HINTS
 ===================
 
-RoundCube writes internal errors to the 'errors' log file located in the logs
+Roundcube writes internal errors to the 'errors' log file located in the logs
 directory which can be configured in config/main.inc.php. If you want ordinary
 PHP errors to be logged there as well, enable the 'php_value error_log' line
 in the .htaccess file and set the path to the log file accordingly.
@@ -66,7 +66,7 @@
 DATABASE SETUP
 ==============
 
-Note: Database for RoundCube must use UTF-8 character set.
+Note: Database for Roundcube must use UTF-8 character set.
 
 * MySQL
 -------
@@ -106,7 +106,7 @@
 
 * PostgreSQL
 ------------
-To use RoundCube with PostgreSQL support you have to follow these
+To use Roundcube with PostgreSQL support you have to follow these
 simple steps, which have to be done as the postgres system user (or
 which ever is the database superuser):
 
@@ -121,6 +121,14 @@
 All this has been tested with PostgreSQL 8.x and 7.4.x. Older
 versions don't have a -O option for the createdb, so if you are
 using that version you'll have to change ownership of the DB later.
+
+
+Database cleaning
+-----------------
+Do keep your database slick and clean we recommend to periodically execute
+bin/cleandb.php which finally removes all records that are marked as deleted.
+Best solution is to install a cronjob running this script daily.
+
 
 
 MANUAL CONFIGURATION
@@ -139,7 +147,7 @@
 UPGRADING
 =========
 
-If you already have a previous version of RoundCube installed,
+If you already have a previous version of Roundcube installed,
 please refer to the instructions in UPGRADING guide.
 
 
@@ -147,9 +155,9 @@
 ==========
 
 There are two forms of optimisation here, compression and caching, both aimed
-at increasing an end user's experience using RoundCube Webmail. Compression
+at increasing an end user's experience using Roundcube Webmail. Compression
 allows the static web pages to be delivered with less bandwidth. The index.php
-of RoundCube Webmail already enables compression on its output. The settings
+of Roundcube Webmail already enables compression on its output. The settings
 below allow compression to occur for all static files. Caching sets HTTP 
 response headers that enable a user's web client to understand what is static
 and how to cache it.
diff --git a/README b/README
index 667e7f4..634c794 100644
--- a/README
+++ b/README
@@ -11,18 +11,18 @@
 
 Introduction:
 -------------
-RoundCube Webmail is a browser-based multilingual IMAP client with an
+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. The user interface is fully
-skinnable using XHTML and CSS 2.
+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 is meant to be a modern webmail solution which is easy to
-install/configure and that runs on a standard PHP plus MySQL, PostgreSQL or SQLite
-configuration. It includes open-source classes/libraries like PEAR
-(http://pear.php.net) and the IMAP wrapper from IlohaMail
-(http://www.ilohamail.org).
+This project includes other open-source classes/libraries from PEAR
+(http://pear.php.net), an IMAP library derrived from IlohaMail
+the TinyMCE rich text editor, Googiespell library for spell checking
+or the HTML sanitizer by Frederic Motte.
 
 The current development skin uses icons designed by Stephen Horlander and Kevin 
 Gerich for Mozilla.org.
@@ -42,8 +42,8 @@
 
 Contribution:
 -------------
-Want to help make RoundCube the best webmail solution ever?
-RoundCube is open source software. Our developers and contributors all
+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
 
diff --git a/SQL/sqlite.update.sql b/SQL/sqlite.update.sql
index dd2887c..4b9b2f9 100644
--- a/SQL/sqlite.update.sql
+++ b/SQL/sqlite.update.sql
@@ -45,10 +45,48 @@
 
 -- Updates from version 0.3.1
 
-DROP INDEX ix_identities_user_id;
-CREATE INDEX ix_identities_user_id ON identities (user_id, del);
+-- ALTER TABLE identities ADD COLUMN changed datetime NOT NULL default '0000-00-00 00:00:00'; --
 
-ALTER TABLE identities ADD COLUMN changed datetime NOT NULL default '0000-00-00 00:00:00';
+CREATE TABLE temp_identities (
+  identity_id integer NOT NULL PRIMARY KEY,
+  user_id integer NOT NULL default '0',
+  standard tinyint NOT NULL default '0',
+  name varchar(128) NOT NULL default '',
+  organization varchar(128) default '',
+  email varchar(128) NOT NULL default '',
+  "reply-to" varchar(128) NOT NULL default '',
+  bcc varchar(128) NOT NULL default '',
+  signature text NOT NULL default '',
+  html_signature tinyint NOT NULL default '0'
+);
+INSERT INTO temp_identities (identity_id, user_id, standard, name, organization, email, "reply-to", bcc, signature, html_signature)
+  SELECT identity_id, user_id, standard, name, organization, email, "reply-to", bcc, signature, html_signature
+  FROM identities WHERE del=0;
+
+DROP INDEX ix_identities_user_id;
+DROP TABLE identities;
+
+CREATE TABLE identities (
+  identity_id integer NOT NULL PRIMARY KEY,
+  user_id integer NOT NULL default '0',
+  changed datetime NOT NULL default '0000-00-00 00:00:00',
+  del tinyint NOT NULL default '0',
+  standard tinyint NOT NULL default '0',
+  name varchar(128) NOT NULL default '',
+  organization varchar(128) default '',
+  email varchar(128) NOT NULL default '',
+  "reply-to" varchar(128) NOT NULL default '',
+  bcc varchar(128) NOT NULL default '',
+  signature text NOT NULL default '',
+  html_signature tinyint NOT NULL default '0'
+);
+CREATE INDEX ix_identities_user_id ON identities(user_id, del);
+
+INSERT INTO identities (identity_id, user_id, standard, name, organization, email, "reply-to", bcc, signature, html_signature)
+  SELECT identity_id, user_id, standard, name, organization, email, "reply-to", bcc, signature, html_signature
+  FROM temp_identities;
+
+DROP TABLE temp_identities;
 
 CREATE TABLE contactgroups (
   contactgroup_id integer NOT NULL PRIMARY KEY,
diff --git a/installer/test.php b/installer/test.php
index 66698d7..f1218c3 100644
--- a/installer/test.php
+++ b/installer/test.php
@@ -167,7 +167,8 @@
     else if ($RCI->db_schema_check($DB, $update = !empty($_POST['updatedb']))) {
         $RCI->fail('DB Schema', "Database schema differs");
         $updatefile = INSTALL_PATH . 'SQL/' . $DB->db_provider . '.update.sql';
-        echo '<p class="warning">Please manually execute the SQL statements from '.$updatefile.' on your database</p>';
+        echo '<p class="warning">Please manually execute the SQL statements from '.$updatefile.' on your database.<br/>';
+        echo 'See comments in the file and execute queries that are superscribed with the currently installed version number.</p>';
         $db_working = false;
     }
     else {

--
Gitblit v1.9.1