-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdbmodel.sql
More file actions
65 lines (53 loc) · 1.9 KB
/
dbmodel.sql
File metadata and controls
65 lines (53 loc) · 1.9 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
-- ------
-- BGA framework: Gregory Isabelli & Emmanuel Colin & BoardGameArena
-- Postcards implementation : © Tóth Ábel Tibor toth.abel.tibor2@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
CREATE TABLE IF NOT EXISTS travel (
type int(2) UNSIGNED NOT NULL,
location int(10) NOT NULL,
location_arg int(2) UNSIGNED DEFAULT NULL,
PRIMARY KEY (type)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS gift (
type int(2) UNSIGNED NOT NULL,
location int(10) NOT NULL,
location_arg int(2) UNSIGNED DEFAULT NULL,
PRIMARY KEY (type)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS postcard (
type int(2) UNSIGNED NOT NULL,
location int(10) NOT NULL,
location_arg int(2) UNSIGNED DEFAULT NULL,
PRIMARY KEY (type)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS stamp (
postcard int(2) UNSIGNED NOT NULL,
location int(1) UNSIGNED NOT NULL,
PRIMARY KEY (postcard, location)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS camp (
player_id int(10) UNSIGNED NOT NULL,
region int(2) UNSIGNED NOT NULL,
location int(1) UNSIGNED NOT NULL,
PRIMARY KEY (region, location)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS souvenir (
postcard int(2) UNSIGNED NOT NULL,
location int(1) UNSIGNED NOT NULL,
PRIMARY KEY (postcard, location)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS log (
id int(2) UNSIGNED NOT NULL,
gamelog_move_id int(5) UNSIGNED NOT NULL,
type int(2) NOT NULL,
args JSON,
undoable BOOLEAN NOT NULL,
PRIMARY KEY (id)
) ENGINE = InnoDB DEFAULT CHARSET = utf8;
ALTER TABLE player ADD itinerary INT UNSIGNED NOT NULL;
ALTER TABLE player ADD biker INT UNSIGNED NOT NULL;
ALTER TABLE gamelog ADD COLUMN cancel BOOLEAN NOT NULL DEFAULT FALSE;