]> git.sesse.net Git - pr0n/blobdiff - sql/pr0n.sql
Treat CR2 the same as NEF.
[pr0n] / sql / pr0n.sql
index 5fd04e7e9da4872719e7b1cbe9eaf257b0d53077..5f89f6c91e03c8bf62e76684a3718612d8c53218 100644 (file)
@@ -3,7 +3,6 @@ CREATE TABLE events (
     "date" character varying NOT NULL,
     name character varying NOT NULL,
     vhost character varying NOT NULL,
     "date" character varying NOT NULL,
     name character varying NOT NULL,
     vhost character varying NOT NULL,
-    last_update timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
 
     PRIMARY KEY (vhost, event)
 );
 
     PRIMARY KEY (vhost, event)
 );
@@ -13,9 +12,10 @@ CREATE TABLE last_picture_cache (
    vhost varchar NOT NULL,
    event varchar NOT NULL,
    last_picture timestamp without time zone,
    vhost varchar NOT NULL,
    event varchar NOT NULL,
    last_picture timestamp without time zone,
+   last_update timestamp with time zone NOT NULL DEFAULT CURRENT_TIMESTAMP,
 
    PRIMARY KEY (vhost,event),
 
    PRIMARY KEY (vhost,event),
-   FOREIGN KEY (vhost,event) REFERNECES events(vhost,event)
+   FOREIGN KEY (vhost,event) REFERENCES events(vhost,event)
 );
 
 CREATE TABLE images (
 );
 
 CREATE TABLE images (
@@ -29,6 +29,8 @@ CREATE TABLE images (
     "date" timestamp without time zone,
     takenby character varying NOT NULL,
     selected boolean DEFAULT false,
     "date" timestamp without time zone,
     takenby character varying NOT NULL,
     selected boolean DEFAULT false,
+    model character varying,
+    lens character varying,
 
     FOREIGN KEY (vhost,event) REFERENCES events (vhost,event)
 );
 
     FOREIGN KEY (vhost,event) REFERENCES events (vhost,event)
 );
@@ -44,7 +46,9 @@ CREATE TABLE deleted_images (
     uploadedby character varying,
     "date" timestamp without time zone,
     takenby character varying NOT NULL,
     uploadedby character varying,
     "date" timestamp without time zone,
     takenby character varying NOT NULL,
-    selected boolean
+    selected boolean,
+    model character varying,
+    lens character varying
 );
 
 CREATE TABLE fake_files (
 );
 
 CREATE TABLE fake_files (
@@ -71,6 +75,8 @@ CREATE TABLE users (
     vhost character varying NOT NULL
 );
 
     vhost character varying NOT NULL
 );
 
+-- Mainly used for manual queries -- usually too slow to be very useful
+-- for web views in the long run.
 CREATE TABLE exif_info (
     image integer NOT NULL REFERENCES images (id) ON DELETE CASCADE,
     key varchar NOT NULL,
 CREATE TABLE exif_info (
     image integer NOT NULL REFERENCES images (id) ON DELETE CASCADE,
     key varchar NOT NULL,