forked from github/server
db schema
This commit is contained in:
parent
2b68e11e24
commit
d83f68696e
1 changed files with 6 additions and 0 deletions
6
src/scripts/schema.sql
Normal file
6
src/scripts/schema.sql
Normal file
|
@ -0,0 +1,6 @@
|
|||
CREATE TABLE email(id INTEGER PRIMARY KEY, md5 VARCHAR(32) UNIQUE NOT NULL, email VARCHAR(32), bounces INT DEFAULT 0, confirmed TIMESTAMP DEFAULT NULL);
|
||||
CREATE TABLE faction (id INTEGER PRIMARY KEY, user_id INTEGER REFERENCES user(id), no INTEGER, name VARCHAR(64), game_id INTEGER REFERENCES game(id), race VARCHAR(10), lang CHAR(2));
|
||||
CREATE TABLE faction_email (faction_id INTEGER REFERENCES faction(id), email_id INTEGER REFERENCES email(id));
|
||||
CREATE TABLE game (id INTEGER PRIMARY KEY, name VARCHAR(20), last_turn INTEGER);
|
||||
CREATE TABLE score (turn INTEGER, faction_id INTEGER REFERENCES faction(id), value INTEGER, game_id INTEGER REFERENCES game(id));
|
||||
CREATE TABLE user(id INTEGER PRIMARY KEY, email_id INTEGER REFERENCES email(id), creation TIMESTAMP DEFAULT CURRENT_TIMESTAMP);
|
Loading…
Reference in a new issue