From d83f68696eab5dbde7179bf5bd3ebedd05f8de0a Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Tue, 28 Jul 2009 05:57:58 +0000 Subject: [PATCH] db schema --- src/scripts/schema.sql | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 src/scripts/schema.sql diff --git a/src/scripts/schema.sql b/src/scripts/schema.sql new file mode 100644 index 000000000..45d3573ad --- /dev/null +++ b/src/scripts/schema.sql @@ -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);