From 396f302937cc83c8cb50e4bba64b67f4b76b7c13 Mon Sep 17 00:00:00 2001 From: Kevin J Hoerr Date: Sun, 26 Aug 2018 22:04:41 -0400 Subject: Add Diesel schema and initial migration SQL files --- src/schema.rs | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 src/schema.rs (limited to 'src/schema.rs') diff --git a/src/schema.rs b/src/schema.rs new file mode 100644 index 0000000..2f0daba --- /dev/null +++ b/src/schema.rs @@ -0,0 +1,66 @@ +table! { + users(userid) { + userid -> Serial, + email -> VarChar, + firstname -> VarChar, + lastname -> VarChar, + password -> VarChar, + joindate -> Date, + activated -> Bool, + } +} +table! { + activation_keys(code) { + code -> VarChar, + userid -> Serial, + } +} +table! { + games(gameid) { + gameid -> Serial, + title -> VarChar, + gametypeid -> Serial, + players -> SmallInt, + waitfor -> Integer, + lastturn -> Date, + gamestate -> Integer, + } +} +table! { + allegiances(gameid, userid) { + gameid -> Serial, + userid -> Serial, + allegiance -> VarChar, + ordernum -> SmallInt, + playing -> SmallInt, + } +} +table! { + regions(regionid) { + regionid -> Serial, + name -> VarChar, + abbreviation -> Char, + bonus -> Integer, + } +} +table! { + nationstates(nationid) { + nationid -> Serial, + regionid -> Serial, + name -> VarChar, + abbreviation -> Char, + } +} +table! { + borders(nationid, borderid) { + nationid -> Serial, + borderid -> Serial, + } +} +table! { + regions_nationstates(gameid, nationid) { + gameid -> Serial, + nationid -> Serial, + userid -> Serial, + } +} \ No newline at end of file -- cgit