-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathdbmodel.sql
More file actions
43 lines (35 loc) · 1.61 KB
/
Copy pathdbmodel.sql
File metadata and controls
43 lines (35 loc) · 1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
-- ------
-- BGA framework: © Gregory Isabelli <gisabelli@boardgamearena.com> & Emmanuel Colin <ecolin@boardgamearena.com>
-- foogame implementation : © Timothée Pecatte <tim.pecatte@gmail.com>, Vincent Toper <vincent.toper@gmail.com>
--
-- This code has been produced on the BGA studio platform for use on http://boardgamearena.com.
-- See http://en.boardgamearena.com/#!doc/Studio for more information.
-- -----
-- dbmodel.sql
-- This is the file where you are describing the database schema of your game
-- Basically, you just have to export from PhpMyAdmin your table structure and copy/paste
-- this export here.
-- Note that the database itself and the standard tables ("global", "stats", "gamelog" and "player") are
-- already created and must not be created here
-- Note: The database schema is created from this file when the game starts. If you modify this file,
-- you have to restart a game to see your changes in database.
CREATE TABLE IF NOT EXISTS `global_variables` (
`name` varchar(255) NOT NULL,
`value` JSON,
PRIMARY KEY (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `user_preferences` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`player_id` int(10) NOT NULL,
`pref_id` int(10) NOT NULL,
`pref_value` int(10) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `cards` (
`card_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`card_location` varchar(32) NOT NULL,
`card_state` int(10) DEFAULT 0,
`value` int(10) NOT NULL,
`color` int(10) NOT NULL,
PRIMARY KEY (`card_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;