Skip to content
Newer
Older
100644 43 lines (30 sloc) 1.73 KB
ac26b96 @thomascube Optimize database schema; get rid of unnecessary indexes
thomascube authored
1 -- RoundCube Webmail update script for Postgres databases
2 -- Updates from version 0.1-stable to 0.1.1
a0109c4 Initial TinyMCE editor support (still need to work on spellcheck and …
svncommit authored
3
6cb7786 @alecpl #1484854
alecpl authored
4 CREATE INDEX cache_user_id_idx ON cache (user_id, cache_key);
5 CREATE INDEX contacts_user_id_idx ON contacts (user_id);
6 CREATE INDEX identities_user_id_idx ON identities (user_id);
7
8 CREATE INDEX users_username_id_idx ON users (username);
9 CREATE INDEX users_alias_id_idx ON users (alias);
10
11 -- added ON DELETE/UPDATE actions
12 ALTER TABLE messages DROP CONSTRAINT messages_user_id_fkey;
13 ALTER TABLE messages ADD FOREIGN KEY (user_id) REFERENCES users(user_id) ON DELETE CASCADE ON UPDATE CASCADE;
14 ALTER TABLE identities DROP CONSTRAINT identities_user_id_fkey;
15 ALTER TABLE identities ADD FOREIGN KEY (user_id) REFERENCES users(user_id) ON DELETE CASCADE ON UPDATE CASCADE;
16 ALTER TABLE contacts DROP CONSTRAINT contacts_user_id_fkey;
17 ALTER TABLE contacts ADD FOREIGN KEY (user_id) REFERENCES users(user_id) ON DELETE CASCADE ON UPDATE CASCADE;
18 ALTER TABLE cache DROP CONSTRAINT cache_user_id_fkey;
19 ALTER TABLE cache ADD FOREIGN KEY (user_id) REFERENCES users(user_id) ON DELETE CASCADE ON UPDATE CASCADE;
c98f3b5 @alecpl #1485125: added index on messages.created
alecpl authored
20
21 -- Updates from version 0.2-alpha
22
23 CREATE INDEX messages_created_idx ON messages (created);
be7d3b6 @alecpl - Fix 'cache' table cleanup on session destroy (#1485516)
alecpl authored
24
25 -- Updates from version 0.2-beta
26
dcf780a @alecpl - fix r2076: removed cache.session_id column, removed DELETEs from ca…
alecpl authored
27 ALTER TABLE cache DROP session_id;
3e48d2e @alecpl - Increase speed of session destroy and garbage clean up
alecpl authored
28
29 CREATE INDEX session_changed_idx ON session (changed);
e4d9f05 @alecpl - Added index on cache.created + small fixes in mssql DDL script
alecpl authored
30 CREATE INDEX cache_created_idx ON "cache" (created);
debdda0 @alecpl #1485420: remove default (and not null) for users.language column in DDL
alecpl authored
31
32 ALTER TABLE users ALTER "language" DROP NOT NULL;
33 ALTER TABLE users ALTER "language" DROP DEFAULT;
a493ea8 @alecpl - change few "boolean" columns type from integer to smallint
alecpl authored
34
35 ALTER TABLE identities ALTER del TYPE smallint;
36 ALTER TABLE identities ALTER standard TYPE smallint;
37 ALTER TABLE contacts ALTER del TYPE smallint;
38 ALTER TABLE messages ALTER del TYPE smallint;
3d601d2 @alecpl - added index in messages table
alecpl authored
39
40 -- Updates from version 0.3-stable
41
42 CREATE INDEX messages_index_idx ON messages (user_id, cache_key, idx);
Something went wrong with that request. Please try again.