[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CVS Update: gleipnir



Log Message:
-----------
The database changes for the gallery

Added Files:
-----------
    gleipnir/setup/migrate:
        gallery

Revision Data
-------------
--- /dev/null
+++ setup/migrate/gallery
@@ -0,0 +1,68 @@
+create table gallery
+  (galleryid serial,
+	identifier text,
+	description text,
+	gid integer,
+	primary key (galleryid));
+
+grant insert, update, select, delete on gallery to gleipnir;
+grant insert, update, select, delete on gallery_galleryid_seq to gleipnir;
+
+ALTER TABLE ONLY gallery
+    ADD CONSTRAINT gallery_gid_fk FOREIGN KEY (gid) REFERENCES groupname(gid) ON UPDATE CASCADE;
+
+gallery:
+  identifier
+	galleryid
+	description
+
+create table gallery_picture
+	(pictureid serial,
+	gallery integer,
+	caption text,
+	thumb_path text,
+	image_path text,
+	title text,
+	exif text,
+	uploader integer,
+	uploaded timestamp default now(),
+	original_hash text,
+	original_path text,
+	rotated integer,
+	primary key (pictureid));
+
+ALTER TABLE ONLY gallery_picture
+    ADD CONSTRAINT gallery_picture_gallery_fk FOREIGN KEY (gallery) REFERENCES gallery(galleryid) ON UPDATE CASCADE ON DELETE CASCADE;
+ALTER TABLE ONLY gallery_picture
+    ADD CONSTRAINT gallery_picture_uploader_fk FOREIGN KEY (uploader) REFERENCES cnuser(uid) ON UPDATE CASCADE;
+
+grant insert, update, select, delete on gallery_picture to gleipnir;
+grant insert, update, select, delete on gallery_picture_pictureid_seq to gleipnir;
+
+gallery_picture:
+	pictureid
+	caption
+	thumb_path
+	image_path
+	title
+	exif
+	uploader
+	uploaded
+	original_hash
+	original_path
+
+select identifier, galleryid from gallery where $ingroups
+
+select identifier, description from gallery where galleryid = ?
+
+select count(pictureid) from gallery_picture where gallery = ?
+
+select gp.pictureid, gp.caption, gp.thumb_path from gallery_picture gp left join gallery g on g.galleryid = gp.gallery
+where $ingroups and gp.gallery = ? limit $limit offset $offset
+
+select gp.pictureid, gp.gallery, gp.image_path, gp.title, gp.caption, gp.exif, gp.uploader, gp.uploaded, g.identifier, g.description
+from gallery_picture gp left join gallery g on g.galleryid = gp.gallery where gp.pictureid = ? and $ingroups
+
+select identifier, galleryid from gallery where $ingroups
+
+select nextval('gallery_picture_pictureid_seq')


Main Menu:

Site Tools:


Here, spammer, have some addresses.