Changing the Database

gnurob

Joined: 2005-11-17
Posts: 1
Posted: Thu, 2005-11-17 16:13

Experimenting with a new Gallery 2 installation (great work BTW) has left my gallery many albums using different album settings. The resized images and thumbnail sizes being two of the most time consuming to fix.

A few of the changes I'd like to do are:

1. Set resized images to 640, 800, 1024 and 1600 pixel height and width.

It seems sub-albums do not inherit my gallery album settings and/or changing the gallery album is not recursive. Given the number of albums, it would be much easier to do this with an SQL UPDATE.

2. Set all thumbnails to 150 pixels squared.

Well, I was using 120 for a while and changed my mind. Now its a big mix-up. :-P

3. Reset permissions in selected albums.

Sometimes users add photos to their private albums that were meant for a shared gallery. Albums/items moved to the shared gallery maintain their permissions; making for a time consuming task of deleting permissions and recursively setting them to the shared gallery values. I'd rather have an SQL statement ready to go (e.g. mysql -p gallery2 < reset-shared.sql) in a script of some sort. Actually, this would be helpful for my paranoia that my private items will accidently be reset to public (at least a cron job could keeep fixing them JIC such an accident occurs).

What I would like is some sort of documentation on the tables/colums used by Gallery 2... of course, I'll just take the answer if you have it! A search in How To, FAQ and the forums turned up nothing.

Thanks

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Thu, 2005-11-17 20:18

1. subalbums do not inherit these changes. only new subalbum inerhit these new settings.
an sql update would be easier for mass edits right now, true.
2. same here
3. permission changes are inherited by subalbums/items.
yes, when moving permissions are maintained.
you could create a module to change this behavior

the db scheme is closely related to G2's architecture.
there are Entities and maps.
here's an overview over the entities (tables):
it's a little out of date though:
http://gallery.menalto.com/gallery/miscellaneous/aaf.png.html?g2_imageViewsIndex=1

example:
a GalleryPhotoItem has a row with the same g_id in all db tables from entity over childentity, ... down to photoitem. plus some rows in other tables too (permissions maps, ...)

derivative / derivativeimage -> existing resize and thumbs
prefsmap -> settings