From 6ec792e3bd633a0b3971e401d29b2f8671f38b14 Mon Sep 17 00:00:00 2001 From: Ilion Beyst Date: Thu, 7 Jul 2022 18:57:46 +0200 Subject: NewBotVersion --- planetwars-server/src/db/bots.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'planetwars-server/src/db/bots.rs') diff --git a/planetwars-server/src/db/bots.rs b/planetwars-server/src/db/bots.rs index 53c11b1..1654f43 100644 --- a/planetwars-server/src/db/bots.rs +++ b/planetwars-server/src/db/bots.rs @@ -45,9 +45,10 @@ pub fn find_all_bots(conn: &PgConnection) -> QueryResult> { #[derive(Insertable)] #[table_name = "bot_versions"] -pub struct NewCodeBundle<'a> { +pub struct NewBotVersion<'a> { pub bot_id: Option, - pub code_bundle_path: &'a str, + pub code_bundle_path: Option<&'a str>, + pub container_digest: Option<&'a str>, } #[derive(Queryable, Serialize, Deserialize, Debug)] @@ -59,12 +60,12 @@ pub struct BotVersion { pub container_digest: Option, } -pub fn create_code_bundle( - new_code_bundle: &NewCodeBundle, +pub fn create_bot_version( + new_bot_version: &NewBotVersion, conn: &PgConnection, ) -> QueryResult { diesel::insert_into(bot_versions::table) - .values(new_code_bundle) + .values(new_bot_version) .get_result(conn) } -- cgit v1.2.3