X-Git-Url: https://git.sesse.net/?p=pr0n;a=blobdiff_plain;f=sql%2Fpr0n.sql;h=9d1f9374d3bae4e86a9fbd92dfa288d17cfb8c77;hp=c1349e7e4e5aea9ad58c382870bf70d653c28b54;hb=5d4b5b0f5ce417f702b3e2c750287441ccd1aedd;hpb=bc5325d47cbf017a7c4cebe9695edbd484fd18b2 diff --git a/sql/pr0n.sql b/sql/pr0n.sql index c1349e7..9d1f937 100644 --- a/sql/pr0n.sql +++ b/sql/pr0n.sql @@ -2,8 +2,13 @@ CREATE TABLE events ( id character varying NOT NULL PRIMARY KEY, 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 + vhost character varying NOT NULL +); + +-- 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 (