Table of Contents

Database Reference

The following is a complete list of all singapore database tables and their respective fields. CSV files or MySQL database tables can be used on install.

CSV database format

If you choose to use metadata files then each gallery must contain a CSV (comma separated values) file called metadata.csv containing the information about images in the gallery and the gallery itself. CSV files can be edited manually (in a text editor such as Notepad) or using a spreadsheet application (such as MS Excel). Care must be taken when using Excel to save using commas as the separator character and not tabs or semi-colons.

Galleries

The first line of each file stores human-readable descriptions of the fields and is ignored by singapore. The second line stores information about this gallery:

Field Description
field 0the filename of the image used to represent the gallery in the gallery list
field 1(not used)
field 2the owner of the gallery
field 3space-separated list of usergroups
field 4gallery permission flags
field 5space-separated list of categories the gallery belongs in (not used)
field 6gallery name/title
field 7artist name (optional)
field 8artist email (optional)
field 9copyright holder (optional)
field 10description of the gallery (optional)
field 11short summary of the gallery (optional)
field 12human-readable date (optional)
field 13onwards (not used)

Images

Each of the following lines (3 - …) represents an image in the gallery. The format is as follows:

Field Description
field 0the filename of the image
field 1the filename of the thumbnail image
field 2the owner of the image
field 3space-separated list of usergroups
field 4image permission flags
field 5space-separated list of categories the image belongs in (not used)
field 6image name/title
field 7artist name (optional)
field 8artist email (optional)
field 9copyright holder (optional)
field 10description of the image (optional)
field 11location that the image was taken/made/represents (optional)
field 12date taken/made (optional)
field 13make and model of camera used (optional)
field 14make and model of lens used (optional)
field 15make and type of film used (optional)
field 16darkroom manipulation (optional)
field 17digital manipulation (optional)

MySQL database format

sg_galleries

Field Type Default Description
id varchar(250)
lang varchar(16)
filename varchar(200) NULL the filename of the image used to represent the gallery in the gallery list
owner varchar(32) NULLthe owner of the gallery
groups varchar(64) NULLspace-separated list of usergroups
permissions int(10) NULLgallery permission flags
categories varchar(255) NULLspace-separated list of categories the gallery belongs in (not used)
name varchar(255) NULL gallery name/title
artist varchar(255) NULLartist name (optional)
email varchar(255) NULLartist email (optional)
copyright varchar(255) NULLcopyright holder (optional)
description text NULLdescription of the gallery (optional)
summary text NULLshort summary of the gallery (optional)
date varchar(255) NULLhuman-readable date (optional)
hits smallint(5) NULL
lasthit int(10) NULL

sg_images

Field Type Default Description
galleryid varchar(250)
filename varchar(200) the filename of the image
lang varchar(16)
thumbnail varchar(255) NULLthe filename of the thumbnail image
owner varchar(32) NULLthe owner of the image
groups varchar(64) NULLspace-separated list of usergroups
permissions int(11) NULLimage permission flags
categories varchar(64) NULLspace-separated list of categories the image belongs in (not used)
name varchar(255) NULLimage name/title
artist varchar(255) NULLartist name (optional)
email varchar(255) NULLartist email (optional)
copyright varchar(255) NULLcopyright holder (optional)
description text NULLdescription of the image (optional)
width smallint(5) NULL
height smallint(5) NULL
type tinyint(3) NULL
location varchar(255) NULLlocation that the image was taken/made/represents (optional)
date varchar(255) NULLdate taken/made (optional)
camera varchar(255) NULLmake and model of camera used (optional)
lens varchar(255) NULLmake and model of lens used (optional)
film varchar(255) NULLmake and type of film used (optional)
darkroom text NULLdarkroom manipulation (optional)
digital text NULLdigital manipulation (optional)
hits smallint(5) NULL
lasthit int(10) NULL

sg_users

Field Type Default Description
username varchar(32)
userpass varchar(32)
permissions int(10) NULL
groups varchar(64) NULL
email varchar(255) NULL
fullname varchar(255) NULL
description varchar(255) NULL
stats varchar(255) NULL