diff options
author | Ilion Beyst <ilion.beyst@gmail.com> | 2022-07-07 18:57:46 +0200 |
---|---|---|
committer | Ilion Beyst <ilion.beyst@gmail.com> | 2022-07-07 18:57:46 +0200 |
commit | 6ec792e3bd633a0b3971e401d29b2f8671f38b14 (patch) | |
tree | 932e4c39c9927630427775543ad311445deb98dd /planetwars-server/src/db/bots.rs | |
parent | d7b7585dd70f9d41184cf88c2ecbd88341898c38 (diff) | |
download | planetwars.dev-6ec792e3bd633a0b3971e401d29b2f8671f38b14.tar.xz planetwars.dev-6ec792e3bd633a0b3971e401d29b2f8671f38b14.zip |
NewBotVersion
Diffstat (limited to 'planetwars-server/src/db/bots.rs')
-rw-r--r-- | planetwars-server/src/db/bots.rs | 11 |
1 files changed, 6 insertions, 5 deletions
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<Vec<Bot>> { #[derive(Insertable)] #[table_name = "bot_versions"] -pub struct NewCodeBundle<'a> { +pub struct NewBotVersion<'a> { pub bot_id: Option<i32>, - 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<String>, } -pub fn create_code_bundle( - new_code_bundle: &NewCodeBundle, +pub fn create_bot_version( + new_bot_version: &NewBotVersion, conn: &PgConnection, ) -> QueryResult<BotVersion> { diesel::insert_into(bot_versions::table) - .values(new_code_bundle) + .values(new_bot_version) .get_result(conn) } |