This is a documentation for Board Game Arena: play board games online !

Game database model: dbmodel.sql

Innen: Board Game Arena
A lap korábbi változatát látod, amilyen Sourisdudesert (vitalap | szerkesztései) 2013. január 11., 15:41-kor történt szerkesztése után volt. (Created page with "In this file you specify the database schema of your game. This file contains SQL queries that will be executed during the creation of your game table. Note: you can't chang...")
(eltér) ← Régebbi változat | Aktuális változat (eltér) | Újabb változat→ (eltér)
Ugrás a navigációhoz Ugrás a kereséshez
A nyomtatható változat már nem támogatott, és hibásan jelenhet meg. Kérjük, frissítsd a böngésződ könyvjelzőit, és használd a böngésző alapértelmezett nyomtatás funkcióját.

In this file you specify the database schema of your game.

This file contains SQL queries that will be executed during the creation of your game table.

Note: you can't change the database schema during the game.

Create your schema

To build this file, we recommend you to build the tables you need with the PhpMyAdmin tool (see BGA user guide), and then to export them and to copy/paste the content inside this file.

Default tables

Important: by default, BGA creates 4 tables for your game: global, stats, gamelog, and player.

You must not modify the schema of global, stats and gamelog tables (and you must not access them directly with SQL queries in your PHP code).

You may add columns to "player" table. This is very practical to add simple values associated with players.

Example:

ALTER TABLE `player` ADD `player_reserve_size` SMALLINT UNSIGNED NOT NULL DEFAULT '7';

For your information, the useful columns of default "player" table are:

  • player_no: the index of player in natural playing order.
  • player_id
  • player_name: (note: you should better access this date with getActivePlayerName() or loadPlayersBasicInfos() methods)
  • player_score: the current score of the player (displayed in the player panel). You must update this field to update player's scores.
  • player_score_aux: the secondary score, used as a tie breaker. You must update this field according to tie breaking rules of the game.