X-Git-Url: https://git.sesse.net/?p=pr0n;a=blobdiff_plain;f=sql%2Fpr0n.sql;h=583b00f287a3e444cbc8ebf103189af0bb4bf642;hp=c1349e7e4e5aea9ad58c382870bf70d653c28b54;hb=ae5878d9037c0c23882e3b976d00ea1ee6ae5e8f;hpb=bc5325d47cbf017a7c4cebe9695edbd484fd18b2 diff --git a/sql/pr0n.sql b/sql/pr0n.sql index c1349e7..583b00f 100644 --- a/sql/pr0n.sql +++ b/sql/pr0n.sql @@ -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 (