-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdbmodel.sql
56 lines (48 loc) · 2.21 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
48
49
50
51
52
53
54
55
56
-- ------
-- BGA framework: © Gregory Isabelli <gisabelli@boardgamearena.com> & Emmanuel Colin <ecolin@boardgamearena.com>
-- Hardback implementation : © quietmint
--
-- 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 `card` (
`id` int(3) unsigned NOT NULL AUTO_INCREMENT,
`refId` int(3) unsigned NOT NULL,
`location` varchar(32) NOT NULL,
`order` int(3) NOT NULL DEFAULT -1,
`origin` varchar(32) NOT NULL,
`factor` int(1) NOT NULL DEFAULT 1,
`ink` int(1),
`wild` char(1),
`age` timestamp(6) NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;
CREATE TABLE IF NOT EXISTS `resolve` (
`id` int(10) unsigned NOT NULL,
`benefit_id` int(10) unsigned NOT NULL,
PRIMARY KEY (`id`, `benefit_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;
CREATE TABLE IF NOT EXISTS `word` (
`id` int(10) unsigned NOT NULL,
`player_id` int(10) unsigned NOT NULL,
`word` VARCHAR(32) NOT NULL,
`coins` INT NOT NULL DEFAULT 0,
`score` INT NOT NULL DEFAULT 0,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;
ALTER TABLE `player` ADD `coins` INT NOT NULL DEFAULT 0;
ALTER TABLE `player` ADD `ink` INT NOT NULL DEFAULT 0;
ALTER TABLE `player` ADD `remover` INT NOT NULL DEFAULT 0;
ALTER TABLE `player` ADD `award` INT NOT NULL DEFAULT 0;
ALTER TABLE `player` ADD `advert` INT NOT NULL DEFAULT 0;
ALTER TABLE `player` ADD `word` VARCHAR(32) NULL DEFAULT NULL;
ALTER TABLE `player` ADD `vote` INT(1) NULL DEFAULT NULL;
ALTER TABLE `player` ADD `replayFrom` INT(10) UNSIGNED NULL DEFAULT NULL;