planetwars.dev/planetwars-server/src/schema.rs

101 lines
1.9 KiB
Rust
Raw Normal View History

// This file is autogenerated by diesel
#![allow(unused_imports)]
2021-12-18 23:16:46 +00:00
table! {
2022-01-03 22:33:00 +00:00
use diesel::sql_types::*;
use crate::db_types::*;
2022-07-05 18:34:20 +00:00
bot_versions (id) {
2021-12-18 23:16:46 +00:00
id -> Int4,
2022-07-05 18:34:20 +00:00
bot_id -> Nullable<Int4>,
code_bundle_path -> Nullable<Text>,
created_at -> Timestamp,
container_digest -> Nullable<Text>,
2021-12-18 23:16:46 +00:00
}
}
table! {
2022-01-03 22:33:00 +00:00
use diesel::sql_types::*;
use crate::db_types::*;
2022-07-05 18:34:20 +00:00
bots (id) {
2021-12-18 23:16:46 +00:00
id -> Int4,
2022-07-05 18:34:20 +00:00
owner_id -> Nullable<Int4>,
name -> Text,
2022-07-23 21:40:25 +00:00
active_version -> Nullable<Int4>,
2021-12-18 23:16:46 +00:00
}
}
2022-01-02 15:14:03 +00:00
table! {
2022-01-03 22:33:00 +00:00
use diesel::sql_types::*;
use crate::db_types::*;
2022-01-02 15:14:03 +00:00
match_players (match_id, player_id) {
match_id -> Int4,
player_id -> Int4,
2022-07-06 20:41:27 +00:00
bot_version_id -> Nullable<Int4>,
2022-01-02 15:14:03 +00:00
}
}
table! {
2022-01-03 22:33:00 +00:00
use diesel::sql_types::*;
use crate::db_types::*;
2022-01-02 15:14:03 +00:00
matches (id) {
id -> Int4,
2022-01-03 22:33:00 +00:00
state -> Match_state,
2022-01-02 15:14:03 +00:00
log_path -> Text,
created_at -> Timestamp,
2022-05-29 09:41:52 +00:00
winner -> Nullable<Int4>,
2022-01-02 15:14:03 +00:00
}
}
2022-05-09 17:41:33 +00:00
table! {
use diesel::sql_types::*;
use crate::db_types::*;
ratings (bot_id) {
bot_id -> Int4,
rating -> Float8,
}
}
table! {
2022-01-03 22:33:00 +00:00
use diesel::sql_types::*;
use crate::db_types::*;
sessions (id) {
id -> Int4,
user_id -> Int4,
token -> Varchar,
}
}
table! {
2022-01-03 22:33:00 +00:00
use diesel::sql_types::*;
use crate::db_types::*;
users (id) {
id -> Int4,
username -> Varchar,
password_salt -> Bytea,
password_hash -> Bytea,
}
}
2021-12-18 23:16:46 +00:00
joinable!(bots -> users (owner_id));
2022-07-06 20:41:27 +00:00
joinable!(match_players -> bot_versions (bot_version_id));
2022-01-02 15:14:03 +00:00
joinable!(match_players -> matches (match_id));
2022-05-09 17:41:33 +00:00
joinable!(ratings -> bots (bot_id));
joinable!(sessions -> users (user_id));
2022-05-09 17:41:33 +00:00
allow_tables_to_appear_in_same_query!(
2022-07-05 18:34:20 +00:00
bot_versions,
2022-05-09 17:41:33 +00:00
bots,
match_players,
matches,
ratings,
sessions,
users,
);