[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
CVS Update: gleipnir
- To: cvs@lists.cleannorth.org
- Subject: CVS Update: gleipnir
- From: Dan Brosemer <odin@cleannorth.org>
- Date: Mon, 18 Aug 2008 17:16:23 -0400 (EDT)
- List-help: <mailto:cvs-request@lists.cleannorth.org?subject=help>
- List-post: <mailto:cvs@lists.cleannorth.org>
- List-subscribe: <mailto:cvs-request@lists.cleannorth.org?subject=subscribe>
- List-unsubscribe: <mailto:cvs-request@lists.cleannorth.org?subject=unsubscribe>
- Resent-date: Mon, 18 Aug 2008 17:16:26 -0400 (EDT)
- Resent-from: cvs@lists.cleannorth.org
- Resent-message-id: <xT-qzC.A.K9B.AbeqIB@skroob.cleannorth.org>
- Resent-sender: cvs-request@lists.cleannorth.org
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')
- Prev by Date: CVS Update: fgo.ca
- Next by Date: CVS Update: fgo.ca
- Previous by thread: CVS Update: gleipnir
- Next by thread: CVS Update: gleipnir
- Index(es):