aboutsummaryrefslogtreecommitdiff
path: root/planetwars-server/src/db
diff options
context:
space:
mode:
authorIlion Beyst <ilion.beyst@gmail.com>2022-07-07 18:57:46 +0200
committerIlion Beyst <ilion.beyst@gmail.com>2022-07-07 18:57:46 +0200
commit6ec792e3bd633a0b3971e401d29b2f8671f38b14 (patch)
tree932e4c39c9927630427775543ad311445deb98dd /planetwars-server/src/db
parentd7b7585dd70f9d41184cf88c2ecbd88341898c38 (diff)
downloadplanetwars.dev-6ec792e3bd633a0b3971e401d29b2f8671f38b14.tar.xz
planetwars.dev-6ec792e3bd633a0b3971e401d29b2f8671f38b14.zip
NewBotVersion
Diffstat (limited to 'planetwars-server/src/db')
-rw-r--r--planetwars-server/src/db/bots.rs11
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)
}