aboutsummaryrefslogtreecommitdiff
path: root/planetwars-server/src/schema.rs
blob: bf58434bdacc619f0b743173c989c113a32448d5 (plain)
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
table! {
    bots (id) {
        id -> Int4,
        owner_id -> Int4,
        name -> Text,
    }
}

table! {
    code_bundles (id) {
        id -> Int4,
        bot_id -> Int4,
        path -> Text,
        created_at -> Timestamp,
    }
}

table! {
    sessions (id) {
        id -> Int4,
        user_id -> Int4,
        token -> Varchar,
    }
}

table! {
    users (id) {
        id -> Int4,
        username -> Varchar,
        password_salt -> Bytea,
        password_hash -> Bytea,
    }
}

joinable!(bots -> users (owner_id));
joinable!(code_bundles -> bots (bot_id));
joinable!(sessions -> users (user_id));

allow_tables_to_appear_in_same_query!(bots, code_bundles, sessions, users,);