]> git.sesse.net Git - pr0n/blobdiff - sql/pr0n.sql
Support caching of the index pages. (Cache invalidation coming soon!)
[pr0n] / sql / pr0n.sql
index c1349e7e4e5aea9ad58c382870bf70d653c28b54..583b00f287a3e444cbc8ebf103189af0bb4bf642 100644 (file)
@@ -3,7 +3,13 @@ CREATE TABLE events (
     date character varying NOT NULL,
     name character varying NOT NULL,
     vhost character varying NOT NULL,
-    last_picture timestamp without time zone DEFAULT '1970-01-01 00:00:00'::timestamp without time zone NOT NULL
+    last_update timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
+);
+
+-- In a separate table to avoid deadlocks.
+CREATE TABLE last_picture_cache ( 
+   event varchar PRIMARY KEY references events ( id ),
+   last_picture timestamp without time zone
 );
 
 CREATE TABLE images (