aboutsummaryrefslogtreecommitdiff
path: root/planetwars-server/src/schema.rs
blob: d632a3260463ddf671c536191d5d250f483f2b92 (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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
// This file is autogenerated by diesel
#![allow(unused_imports)]

table! {
    use diesel::sql_types::*;
    use crate::db_types::*;

    bot_versions (id) {
        id -> Int4,
        bot_id -> Nullable<Int4>,
        code_bundle_path -> Nullable<Text>,
        created_at -> Timestamp,
        container_digest -> Nullable<Text>,
    }
}

table! {
    use diesel::sql_types::*;
    use crate::db_types::*;

    bots (id) {
        id -> Int4,
        owner_id -> Nullable<Int4>,
        name -> Text,
    }
}

table! {
    use diesel::sql_types::*;
    use crate::db_types::*;

    match_players (match_id, player_id) {
        match_id -> Int4,
        player_id -> Int4,
        code_bundle_id -> Nullable<Int4>,
    }
}

table! {
    use diesel::sql_types::*;
    use crate::db_types::*;

    matches (id) {
        id -> Int4,
        state -> Match_state,
        log_path -> Text,
        created_at -> Timestamp,
        winner -> Nullable<Int4>,
    }
}

table! {
    use diesel::sql_types::*;
    use crate::db_types::*;

    ratings (bot_id) {
        bot_id -> Int4,
        rating -> Float8,
    }
}

table! {
    use diesel::sql_types::*;
    use crate::db_types::*;

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

table! {
    use diesel::sql_types::*;
    use crate::db_types::*;

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

joinable!(bot_versions -> bots (bot_id));
joinable!(bots -> users (owner_id));
joinable!(match_players -> bot_versions (code_bundle_id));
joinable!(match_players -> matches (match_id));
joinable!(ratings -> bots (bot_id));
joinable!(sessions -> users (user_id));

allow_tables_to_appear_in_same_query!(
    bot_versions,
    bots,
    match_players,
    matches,
    ratings,
    sessions,
    users,
);