diff options
author | Ilion Beyst <ilion.beyst@gmail.com> | 2021-12-29 19:56:31 +0100 |
---|---|---|
committer | Ilion Beyst <ilion.beyst@gmail.com> | 2021-12-29 19:56:31 +0100 |
commit | 3eeaab6cec70e7a06a99a1ac2662974f71064bee (patch) | |
tree | 9d5a2665ed32df41b2be131d5e27e8b321ce78a8 /backend/src/schema.rs | |
parent | ee5af8d07625bfc7ad11b842b3941bb095aa6a6e (diff) | |
parent | 1fb4a5151bd8cfe6de4d8c19e2066a9281a0b61a (diff) | |
download | planetwars.dev-3eeaab6cec70e7a06a99a1ac2662974f71064bee.tar.xz planetwars.dev-3eeaab6cec70e7a06a99a1ac2662974f71064bee.zip |
Merge branch 'backend-server'
Diffstat (limited to 'backend/src/schema.rs')
-rw-r--r-- | backend/src/schema.rs | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/backend/src/schema.rs b/backend/src/schema.rs new file mode 100644 index 0000000..bf58434 --- /dev/null +++ b/backend/src/schema.rs @@ -0,0 +1,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,); |