2 id character varying NOT NULL PRIMARY KEY,
3 date character varying NOT NULL,
4 name character varying NOT NULL,
5 vhost character varying NOT NULL,
6 last_update timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
9 -- In a separate table to avoid deadlocks.
10 CREATE TABLE last_picture_cache (
11 event varchar PRIMARY KEY references events ( id ),
12 last_picture timestamp without time zone
16 id serial NOT NULL PRIMARY KEY,
17 event character varying NOT NULL REFERENCES events(id),
18 filename character varying NOT NULL,
19 width integer DEFAULT -1 NOT NULL,
20 height integer DEFAULT -1 NOT NULL,
21 uploadedby character varying NOT NULL,
22 date timestamp without time zone,
23 takenby character varying NOT NULL,
24 selected boolean DEFAULT false
26 CREATE UNIQUE INDEX unique_filenames ON images USING btree (event, filename);
28 CREATE TABLE deleted_images (
30 event character varying(32) NOT NULL,
31 filename character varying(255) NOT NULL,
32 width integer DEFAULT -1 NOT NULL,
33 height integer DEFAULT -1 NOT NULL,
34 uploadedby character varying(32),
35 date timestamp without time zone,
36 takenby character varying(32) NOT NULL,
40 CREATE TABLE fake_files (
41 event character varying(32) NOT NULL REFERENCES events(id),
42 filename character varying(255) NOT NULL,
43 expires_at timestamp without time zone NOT NULL,
45 PRIMARY KEY ( event, filename )
48 CREATE TABLE shadow_files (
49 event character varying(32) NOT NULL,
50 filename character varying(255) NOT NULL,
52 expires_at timestamp without time zone NOT NULL
56 username character varying(32) NOT NULL,
57 sha1password character(28) NOT NULL,
58 vhost character varying(32) NOT NULL
61 CREATE TABLE exif_info (
62 image integer NOT NULL REFERENCES images (id),
64 value varchar NOT NULL,
66 PRIMARY KEY ( image, tag )
70 GRANT INSERT ON TABLE deleted_images TO pr0n;
71 GRANT INSERT,SELECT,UPDATE,DELETE ON TABLE events TO pr0n;
72 GRANT INSERT,SELECT,UPDATE,DELETE ON TABLE fake_files TO pr0n;
73 GRANT INSERT,SELECT,UPDATE ON TABLE imageid_seq TO pr0n;
74 GRANT INSERT,SELECT,UPDATE,DELETE ON TABLE images TO pr0n;
75 GRANT INSERT,SELECT,UPDATE,DELETE ON TABLE shadow_files TO pr0n;
76 GRANT SELECT ON TABLE users TO pr0n;
77 GRANT SELECT,INSERT,DELETE ON TABLE exif_info TO pr0n;