GGZ Gaming Zone Database Documentation

Revision: 0.1
Date: 12.12.2004
Author: Josef Spillner <josef at ggzgamingzone dot org>

This is a supplemental documentation. More information can be found in the GGZ Hosting Guide.

Database Overview

The GGZ server makes extensive use of its database. There can either be a basic installation, or a full installation. The full installation is currently only supported by the PostgreSQL and MySQL backends, while the libdb variants are limited to the basic installation. Running a GGZ server ('ggzd') does not require the full installation, but operating the web interface (ggz-community) does.

The database backend has to be selected at compile time, for only one can be present at a time. The following graphics illustrates the programmer's view on the GGZ database.

GGZ database source code structure

The server is designed to create all structures automatically on its first startup, using the connection data specified in ggzd.conf. This only includes the basic setup however, so it can operate at minimum level, so it's recommended to use the provided SQL schema files for the table creation before starting ggzd.

Tables and Relations

The following image describes visually the database structure. The basic installation covers the tables users and stats. The tables matchplayers, tournamentplayers and teammembers are relations between entries of the table users on the one hand, and matches, tournaments and teams on the other.

GGZ database schema

The placements table contains aggregate data, and is maintained by using the external script 'calcrankings'. The game table does not exist in the database, it will however be introduced in later versions and be maintained by the script 'ggzdconfig', together with a table named room.

To edit entries in the database manually, the tool 'ggzduedit' can be used.

Table descriptions

Table users: contains all registered users.

idunique identifier (serial)
handleplayer login name
passwordplayer password
namefull name
emailemail address
lastlogintimestamp of last login
permissionspermission bit mask
The permission bits can be queried using the views 'permissions', to get information about each single bit, and 'permissionmasks', to get information about the admin mask, bot mask and so on. This table is filled by ggzd (or ggz-community) upon registration with at least the id, handle, password and email field.

Table stats: contains one entry for each player-gametype combination.

idunique identifier (serial)
handleplayer login name
gamegametype name
winsnumber of wins
lossesnumber of losses
tiesnumber of ties
forfeitsnumber of forfeits (cancelled games)
ratingcalculated rating (e.g. Elo number)
rankingposition in ranking for this gametype
highscorehighest score ever reached

Table userinfo: (and others) TODO