0
|
1 DROP TABLE "cache";
|
|
2 DROP TABLE "cache_shared";
|
|
3
|
|
4 CREATE TABLE "cache" (
|
|
5 user_id integer NOT NULL
|
|
6 REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE,
|
|
7 cache_key varchar(128) DEFAULT '' NOT NULL,
|
|
8 expires timestamp with time zone DEFAULT NULL,
|
|
9 data text NOT NULL,
|
|
10 PRIMARY KEY (user_id, cache_key)
|
|
11 );
|
|
12
|
|
13 CREATE INDEX cache_expires_idx ON "cache" (expires);
|
|
14
|
|
15 CREATE TABLE "cache_shared" (
|
|
16 cache_key varchar(255) NOT NULL PRIMARY KEY,
|
|
17 expires timestamp with time zone DEFAULT NULL,
|
|
18 data text NOT NULL
|
|
19 );
|
|
20
|
|
21 CREATE INDEX cache_shared_expires_idx ON "cache_shared" (expires);
|