aboutsummaryrefslogtreecommitdiff
path: root/planetwars-server/src/db/bots.rs
diff options
context:
space:
mode:
authorIlion Beyst <ilion.beyst@gmail.com>2022-02-27 20:35:22 +0100
committerIlion Beyst <ilion.beyst@gmail.com>2022-02-27 20:35:22 +0100
commit22a8f3d619e8ef89eeb9a60ab0a27aed01aa93f7 (patch)
tree1d6307c96ebd3456e74509203e1155a2c82ffee1 /planetwars-server/src/db/bots.rs
parent6ef6a872fe3bbe389e92145b39fd88d864f6a790 (diff)
downloadplanetwars.dev-22a8f3d619e8ef89eeb9a60ab0a27aed01aa93f7.tar.xz
planetwars.dev-22a8f3d619e8ef89eeb9a60ab0a27aed01aa93f7.zip
save all uploaded code bundles in database
Diffstat (limited to 'planetwars-server/src/db/bots.rs')
-rw-r--r--planetwars-server/src/db/bots.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/planetwars-server/src/db/bots.rs b/planetwars-server/src/db/bots.rs
index f7d8373..baabd5a 100644
--- a/planetwars-server/src/db/bots.rs
+++ b/planetwars-server/src/db/bots.rs
@@ -42,14 +42,14 @@ pub fn find_all_bots(conn: &PgConnection) -> QueryResult<Vec<Bot>> {
#[derive(Insertable)]
#[table_name = "code_bundles"]
pub struct NewCodeBundle<'a> {
- pub bot_id: i32,
+ pub bot_id: Option<i32>,
pub path: &'a str,
}
#[derive(Queryable, Serialize, Deserialize, Debug)]
pub struct CodeBundle {
pub id: i32,
- pub bot_id: i32,
+ pub bot_id: Option<i32>,
pub path: String,
pub created_at: chrono::NaiveDateTime,
}