From c33cda1f9163deb95beefa5c8f27324644eaac76 Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Fri, 19 Mar 2010 14:58:59 -0400
Subject: [PATCH] - describe config
---
SQL/postgres.initial.sql | 17 ++++++++++-------
1 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/SQL/postgres.initial.sql b/SQL/postgres.initial.sql
index b5f7779..c634b4b 100644
--- a/SQL/postgres.initial.sql
+++ b/SQL/postgres.initial.sql
@@ -1,3 +1,5 @@
+-- RoundCube Webmail initial database structure
+
--
-- Sequence "user_ids"
-- Name: user_ids; Type: SEQUENCE; Schema: public; Owner: postgres
@@ -21,7 +23,7 @@
alias character varying(128) DEFAULT ''::character varying NOT NULL,
created timestamp with time zone DEFAULT now() NOT NULL,
last_login timestamp with time zone DEFAULT now() NOT NULL,
- "language" character varying(5) DEFAULT 'en'::character varying NOT NULL,
+ "language" character varying(5),
preferences text DEFAULT ''::text NOT NULL
);
@@ -65,8 +67,8 @@
CREATE TABLE identities (
identity_id integer DEFAULT nextval('identity_ids'::text) PRIMARY KEY,
user_id integer NOT NULL REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE,
- del integer DEFAULT 0 NOT NULL,
- standard integer DEFAULT 0 NOT NULL,
+ del smallint DEFAULT 0 NOT NULL,
+ standard smallint DEFAULT 0 NOT NULL,
name character varying(128) NOT NULL,
organization character varying(128),
email character varying(128) NOT NULL,
@@ -76,7 +78,7 @@
html_signature integer DEFAULT 0 NOT NULL
);
-CREATE INDEX identities_user_id_idx ON identities (user_id);
+CREATE INDEX identities_user_id_idx ON identities (user_id, del);
--
@@ -100,7 +102,7 @@
contact_id integer DEFAULT nextval('contact_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 integer DEFAULT 0 NOT NULL,
+ del smallint DEFAULT 0 NOT NULL,
name character varying(128) DEFAULT ''::character varying NOT NULL,
email character varying(128) DEFAULT ''::character varying NOT NULL,
firstname character varying(128) DEFAULT ''::character varying NOT NULL,
@@ -108,7 +110,7 @@
vcard text
);
-CREATE INDEX contacts_user_id_idx ON contacts (user_id);
+CREATE INDEX contacts_user_id_idx ON contacts (user_id, email);
--
-- Sequence "cache_ids"
@@ -156,7 +158,7 @@
CREATE TABLE messages (
message_id integer DEFAULT nextval('message_ids'::text) PRIMARY KEY,
user_id integer NOT NULL REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE,
- del integer DEFAULT 0 NOT NULL,
+ del smallint DEFAULT 0 NOT NULL,
cache_key character varying(128) DEFAULT ''::character varying NOT NULL,
created timestamp with time zone DEFAULT now() NOT NULL,
idx integer DEFAULT 0 NOT NULL,
@@ -172,4 +174,5 @@
);
ALTER TABLE messages ADD UNIQUE (user_id, cache_key, uid);
+CREATE INDEX messages_index_idx ON messages (user_id, cache_key, idx);
CREATE INDEX messages_created_idx ON messages (created);
--
Gitblit v1.9.1