annotate SQL/sqlite/2013061000.sql @ 0:4681f974d28b

vanilla 1.3.3 distro, I hope
author Charlie Root
date Thu, 04 Jan 2018 15:52:31 -0500
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
1 DROP TABLE cache_index;
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
2 DROP TABLE cache_thread;
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
3 DROP TABLE cache_messages;
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
4
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
5 ALTER TABLE cache ADD expires datetime DEFAULT NULL;
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
6 DROP INDEX ix_cache_created;
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
7
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
8 ALTER TABLE cache_shared ADD expires datetime DEFAULT NULL;
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
9 DROP INDEX ix_cache_shared_created;
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
10
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
11 UPDATE cache SET expires = datetime(created, '+604800 seconds');
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
12 UPDATE cache_shared SET expires = datetime(created, '+604800 seconds');
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
13
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
14 CREATE INDEX ix_cache_expires ON cache(expires);
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
15 CREATE INDEX ix_cache_shared_expires ON cache_shared(expires);
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
16
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
17 CREATE TABLE cache_index (
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
18 user_id integer NOT NULL,
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
19 mailbox varchar(255) NOT NULL,
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
20 expires datetime DEFAULT NULL,
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
21 valid smallint NOT NULL DEFAULT '0',
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
22 data text NOT NULL,
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
23 PRIMARY KEY (user_id, mailbox)
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
24 );
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
25
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
26 CREATE INDEX ix_cache_index_expires ON cache_index (expires);
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
27
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
28 CREATE TABLE cache_thread (
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
29 user_id integer NOT NULL,
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
30 mailbox varchar(255) NOT NULL,
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
31 expires datetime DEFAULT NULL,
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
32 data text NOT NULL,
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
33 PRIMARY KEY (user_id, mailbox)
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
34 );
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
35
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
36 CREATE INDEX ix_cache_thread_expires ON cache_thread (expires);
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
37
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
38 CREATE TABLE cache_messages (
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
39 user_id integer NOT NULL,
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
40 mailbox varchar(255) NOT NULL,
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
41 uid integer NOT NULL,
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
42 expires datetime DEFAULT NULL,
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
43 data text NOT NULL,
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
44 flags integer NOT NULL DEFAULT '0',
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
45 PRIMARY KEY (user_id, mailbox, uid)
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
46 );
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
47
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
48 CREATE INDEX ix_cache_messages_expires ON cache_messages (expires);