mahjong_service/db_storage/
schema.rs

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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
// @generated automatically by Diesel CLI.

diesel::table! {
    auth_info (user_id) {
        provider -> Text,
        role -> Text,
        user_id -> Text,
    }
}

diesel::table! {
    auth_info_anonymous (user_id) {
        hashed_token -> Text,
        user_id -> Text,
    }
}

diesel::table! {
    auth_info_email (user_id) {
        hashed_pass -> Text,
        user_id -> Text,
        username -> Text,
    }
}

diesel::table! {
    auth_info_github (user_id) {
        token -> Nullable<Text>,
        user_id -> Text,
        username -> Text,
    }
}

diesel::table! {
    auth_info_providers (id) {
        id -> Text,
    }
}

diesel::table! {
    game (id) {
        created_at -> Timestamp,
        id -> Text,
        name -> Text,
        phase -> Text,
        round_claimed_by -> Nullable<Text>,
        round_claimed_from -> Nullable<Text>,
        round_claimed_id -> Nullable<Int4>,
        round_consecutive_same_seats -> Int4,
        round_dealer_index -> Int4,
        round_east_player_index -> Int4,
        round_index -> Int4,
        round_initial_winds -> Nullable<Int4>,
        round_player_index -> Int4,
        round_wall_tile_drawn -> Nullable<Int4>,
        round_wind -> Text,
        #[max_length = 255]
        style -> Varchar,
        updated_at -> Timestamp,
        version -> Text,
    }
}

diesel::table! {
    game_board (game_id, tile_id) {
        game_id -> Text,
        tile_id -> Int4,
        tile_index -> Int4,
    }
}

diesel::table! {
    game_draw_wall (game_id, tile_id, place) {
        game_id -> Text,
        tile_id -> Int4,
        tile_index -> Int4,
        place -> Text,
    }
}

diesel::table! {
    game_hand (game_id, tile_id) {
        concealed -> Int4,
        game_id -> Text,
        player_id -> Text,
        set_id -> Nullable<Text>,
        tile_id -> Int4,
        tile_index -> Int4,
        is_kong -> Bool,
    }
}

diesel::table! {
    game_player (game_id, player_id) {
        game_id -> Text,
        player_id -> Text,
        player_index -> Int4,
    }
}

diesel::table! {
    game_score (game_id, player_id) {
        game_id -> Text,
        player_id -> Text,
        score -> Int4,
    }
}

diesel::table! {
    game_settings (game_id) {
        ai_enabled -> Bool,
        auto_sort_players -> Text,
        auto_stop_claim_meld -> Text,
        discard_wait_ms -> Nullable<Int4>,
        fixed_settings -> Bool,
        game_id -> Text,
        last_discard_time -> Int8,
        dead_wall -> Bool,
    }
}

diesel::table! {
    player (id) {
        created_at -> Timestamp,
        id -> Text,
        is_ai -> Int4,
        name -> Text,
    }
}

diesel::joinable!(auth_info -> auth_info_providers (provider));
diesel::joinable!(auth_info -> player (user_id));
diesel::joinable!(auth_info_anonymous -> auth_info (user_id));
diesel::joinable!(auth_info_email -> auth_info (user_id));
diesel::joinable!(auth_info_github -> auth_info (user_id));
diesel::joinable!(game_board -> game (game_id));
diesel::joinable!(game_draw_wall -> game (game_id));
diesel::joinable!(game_hand -> game (game_id));
diesel::joinable!(game_hand -> player (player_id));
diesel::joinable!(game_player -> game (game_id));
diesel::joinable!(game_player -> player (player_id));
diesel::joinable!(game_score -> game (game_id));
diesel::joinable!(game_score -> player (player_id));
diesel::joinable!(game_settings -> game (game_id));

diesel::allow_tables_to_appear_in_same_query!(
    auth_info,
    auth_info_anonymous,
    auth_info_email,
    auth_info_github,
    auth_info_providers,
    game,
    game_board,
    game_draw_wall,
    game_hand,
    game_player,
    game_score,
    game_settings,
    player,
);