-
Notifications
You must be signed in to change notification settings - Fork 0
/
dbmodel.sql
47 lines (40 loc) · 1.7 KB
/
dbmodel.sql
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
44
45
46
47
-- ------
-- BGA framework: © Gregory Isabelli <[email protected]> & Emmanuel Colin <[email protected]>
-- MyShelfie implementation : © Pietro Luigi Porcedda [email protected]
--
-- 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.
-- -----
ALTER TABLE `player`
ADD `player_personal_goal` TINYINT UNSIGNED NOT NULL,
ADD `player_completed_common_goal_1` BIT DEFAULT 0,
ADD `player_completed_common_goal_2` BIT DEFAULT 0;
CREATE TABLE IF NOT EXISTS `tile` (
`id` TINYINT UNSIGNED NOT NULL,
`location` VARCHAR(8) NOT NULL,
`position_x` TINYINT UNSIGNED,
`position_y` TINYINT UNSIGNED,
`color` VARCHAR(7) NOT NULL,
`type` TINYINT UNSIGNED NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- id: unique tile identifier
-- location: bag (position null), player shelf (playerid), board
-- position: x -> column, y-> row (both null when location is bag)
-- color: tile color (green, white, orange, blue, cyan, fucsia)
-- type: tile variant (drawing on shelf) 1-3 (0-2)
CREATE TABLE IF NOT EXISTS `token` (
`id` TINYINT UNSIGNED NOT NULL,
`n` TINYINT UNSIGNED NOT NULL,
`location` VARCHAR(14) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- id: card number of that type (12 each)
-- type: personal / common
-- player: (if type personal, indicates the player to whom the card is assigned)
CREATE TABLE IF NOT EXISTS `tile_undo` (
`id` TINYINT UNSIGNED NOT NULL,
`position_x` TINYINT UNSIGNED NOT NULL,
`position_y` TINYINT UNSIGNED NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;