-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.sql
55 lines (47 loc) · 1.23 KB
/
schema.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
DROP TABLE st_news, st_money_queue, st_player_stat, st_power_queue, st_company, st_player;
DROP TABLE st_venue;
DROP TABLE st_strategy;
CREATE TABLE st_player (
id SERIAL PRIMARY KEY,
name varchar(200) NOT NULL,
email varchar(200) UNIQUE NOT NULL,
password varchar(200) NOT NULL
);
CREATE TABLE st_player_stat (
id SERIAL PRIMARY KEY,
user_id INTEGER REFERENCES st_player(id),
power INTEGER NOT NULL,
money INTEGER NOT NULL
);
CREATE TABLE st_company (
id SERIAL PRIMARY KEY,
name varchar(200) NOT NULL,
min_cost INTEGER NOT NULL,
chance INTEGER NOT NULL
);
CREATE TABLE st_venue (
id SERIAL PRIMARY KEY,
location varchar(200) NOT NULL,
bonus_strategy INTEGER NOT NULL
);
CREATE TABLE st_strategy (
id INTEGER PRIMARY KEY,
strategy varchar(200) NOT NULL
);
CREATE TABLE st_money_queue (
action_id INTEGER,
user_id INTEGER REFERENCES st_player(id),
company_id INTEGER,
bid_amount INTEGER
);
CREATE TABLE st_power_queue (
action_id INTEGER,
user_id INTEGER REFERENCES st_player(id),
venue_id INTEGER,
strategy_id INTEGER
);
CREATE TABLE st_news (
timestamp TIMESTAMP,
user_id INTEGER REFERENCES st_player(id),
description varchar(255)
);