init rust db backend

This commit is contained in:
2019-06-11 16:14:10 +02:00
parent ba1792ef55
commit 4454bd245c
16 changed files with 204 additions and 2 deletions

37
lootalot_db/src/schema.rs Normal file
View File

@@ -0,0 +1,37 @@
table! {
items (id) {
id -> Nullable<Integer>,
name -> Text,
base_price -> Integer,
}
}
table! {
looted (id) {
id -> Nullable<Integer>,
player_id -> Integer,
item_id -> Integer,
acquired_date -> Nullable<Date>,
}
}
table! {
players (id) {
id -> Nullable<Integer>,
name -> Text,
debt -> Nullable<Integer>,
cp -> Nullable<Integer>,
sp -> Nullable<Integer>,
gp -> Nullable<Integer>,
pp -> Nullable<Integer>,
}
}
joinable!(looted -> items (item_id));
joinable!(looted -> players (player_id));
allow_tables_to_appear_in_same_query!(
items,
looted,
players,
);