aboutsummaryrefslogtreecommitdiff
path: root/planetwars-server/src/modules/registry.rs
diff options
context:
space:
mode:
authorIlion Beyst <ilion.beyst@gmail.com>2022-07-23 23:40:25 +0200
committerIlion Beyst <ilion.beyst@gmail.com>2022-07-23 23:40:25 +0200
commit4a582e8079178a7ac11f2a492e7988fcdaa210cd (patch)
tree1403b3e409e184bb53e0349d7e68e673fe7d7b3c /planetwars-server/src/modules/registry.rs
parentf19a70e710b8bf4605625516aa7e4c0cc7ace2e4 (diff)
downloadplanetwars.dev-4a582e8079178a7ac11f2a492e7988fcdaa210cd.tar.xz
planetwars.dev-4a582e8079178a7ac11f2a492e7988fcdaa210cd.zip
store active version id in bots table
Diffstat (limited to 'planetwars-server/src/modules/registry.rs')
-rw-r--r--planetwars-server/src/modules/registry.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/planetwars-server/src/modules/registry.rs b/planetwars-server/src/modules/registry.rs
index 3f6dad2..297404a 100644
--- a/planetwars-server/src/modules/registry.rs
+++ b/planetwars-server/src/modules/registry.rs
@@ -397,7 +397,10 @@ async fn put_manifest(
code_bundle_path: None,
container_digest: Some(&content_digest),
};
- db::bots::create_bot_version(&new_version, &db_conn).expect("could not save bot version");
+ let version =
+ db::bots::create_bot_version(&new_version, &db_conn).expect("could not save bot version");
+ db::bots::set_active_version(bot.id, Some(version.id), &db_conn)
+ .expect("could not update bot version");
Ok(Response::builder()
.status(StatusCode::CREATED)