annotate SQL/postgres/2013061000.sql @ 34:50ac5484d514

one fix to distro
author Charlie Root
date Sun, 27 May 2018 16:53:56 -0400
parents 1e000243b222
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
1 ALTER TABLE "cache" ADD expires timestamp with time zone DEFAULT NULL;
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
2 ALTER TABLE "cache_shared" ADD expires timestamp with time zone DEFAULT NULL;
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
3 ALTER TABLE "cache_index" ADD expires timestamp with time zone DEFAULT NULL;
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
4 ALTER TABLE "cache_thread" ADD expires timestamp with time zone DEFAULT NULL;
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
5 ALTER TABLE "cache_messages" ADD expires timestamp with time zone DEFAULT NULL;
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
6
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
7 -- initialize expires column with created/changed date + 7days
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
8 UPDATE "cache" SET expires = created + interval '604800 seconds';
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
9 UPDATE "cache_shared" SET expires = created + interval '604800 seconds';
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
10 UPDATE "cache_index" SET expires = changed + interval '604800 seconds';
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
11 UPDATE "cache_thread" SET expires = changed + interval '604800 seconds';
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
12 UPDATE "cache_messages" SET expires = changed + interval '604800 seconds';
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
13
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
14 DROP INDEX cache_created_idx;
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
15 DROP INDEX cache_shared_created_idx;
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
16 ALTER TABLE "cache_index" DROP "changed";
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
17 ALTER TABLE "cache_thread" DROP "changed";
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
18 ALTER TABLE "cache_messages" DROP "changed";
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
19
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
20 CREATE INDEX cache_expires_idx ON "cache" (expires);
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
21 CREATE INDEX cache_shared_expires_idx ON "cache_shared" (expires);
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
22 CREATE INDEX cache_index_expires_idx ON "cache_index" (expires);
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
23 CREATE INDEX cache_thread_expires_idx ON "cache_thread" (expires);
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
24 CREATE INDEX cache_messages_expires_idx ON "cache_messages" (expires);