aboutsummaryrefslogtreecommitdiff
path: root/planetwars-server/src/db/bots.rs
diff options
context:
space:
mode:
authorIlion Beyst <ilion.beyst@gmail.com>2022-07-06 22:41:27 +0200
committerIlion Beyst <ilion.beyst@gmail.com>2022-07-06 22:41:27 +0200
commitd7b7585dd70f9d41184cf88c2ecbd88341898c38 (patch)
tree89a7fc180152f18273159104265e7894718e8560 /planetwars-server/src/db/bots.rs
parentb3df5c6f8cc59e099a2f1db3df8089af4abca02e (diff)
downloadplanetwars.dev-d7b7585dd70f9d41184cf88c2ecbd88341898c38.tar.xz
planetwars.dev-d7b7585dd70f9d41184cf88c2ecbd88341898c38.zip
rename code_bundle to bot_version
Diffstat (limited to 'planetwars-server/src/db/bots.rs')
-rw-r--r--planetwars-server/src/db/bots.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/planetwars-server/src/db/bots.rs b/planetwars-server/src/db/bots.rs
index 964deaa..53c11b1 100644
--- a/planetwars-server/src/db/bots.rs
+++ b/planetwars-server/src/db/bots.rs
@@ -51,7 +51,7 @@ pub struct NewCodeBundle<'a> {
}
#[derive(Queryable, Serialize, Deserialize, Debug)]
-pub struct CodeBundle {
+pub struct BotVersion {
pub id: i32,
pub bot_id: Option<i32>,
pub code_bundle_path: Option<String>,
@@ -62,19 +62,19 @@ pub struct CodeBundle {
pub fn create_code_bundle(
new_code_bundle: &NewCodeBundle,
conn: &PgConnection,
-) -> QueryResult<CodeBundle> {
+) -> QueryResult<BotVersion> {
diesel::insert_into(bot_versions::table)
.values(new_code_bundle)
.get_result(conn)
}
-pub fn find_bot_code_bundles(bot_id: i32, conn: &PgConnection) -> QueryResult<Vec<CodeBundle>> {
+pub fn find_bot_versions(bot_id: i32, conn: &PgConnection) -> QueryResult<Vec<BotVersion>> {
bot_versions::table
.filter(bot_versions::bot_id.eq(bot_id))
.get_results(conn)
}
-pub fn active_code_bundle(bot_id: i32, conn: &PgConnection) -> QueryResult<CodeBundle> {
+pub fn active_bot_version(bot_id: i32, conn: &PgConnection) -> QueryResult<BotVersion> {
bot_versions::table
.filter(bot_versions::bot_id.eq(bot_id))
.order(bot_versions::created_at.desc())