aboutsummaryrefslogtreecommitdiffstats
path: root/rust/src
diff options
context:
space:
mode:
Diffstat (limited to 'rust/src')
-rw-r--r--rust/src/api_server.rs19
-rw-r--r--rust/src/database_models.rs4
-rw-r--r--rust/src/database_schema.rs4
3 files changed, 13 insertions, 14 deletions
diff --git a/rust/src/api_server.rs b/rust/src/api_server.rs
index c91af9c9..5069d15d 100644
--- a/rust/src/api_server.rs
+++ b/rust/src/api_server.rs
@@ -543,8 +543,9 @@ impl Api for Server {
Some(param) => param as i64,
};
- let edit: FileEditRow = diesel::sql_query(
- "WITH rev AS ( INSERT INTO file_rev (size, sha1, url)
+ let edit: FileEditRow =
+ diesel::sql_query(
+ "WITH rev AS ( INSERT INTO file_rev (size, sha1, url)
VALUES ($1, $2, $3)
RETURNING id ),
ident AS ( INSERT INTO file_ident (rev_id)
@@ -553,14 +554,12 @@ impl Api for Server {
INSERT INTO file_edit (editgroup_id, ident_id, rev_id) VALUES
($4, (SELECT ident.id FROM ident), (SELECT rev.id FROM rev))
RETURNING *",
- ).bind::<diesel::sql_types::Nullable<diesel::sql_types::Int4>, _>(
- body.size.map(|v| v as i32),
- )
- .bind::<diesel::sql_types::Nullable<diesel::sql_types::Text>, _>(body.sha1)
- .bind::<diesel::sql_types::Nullable<diesel::sql_types::Text>, _>(body.url)
- .bind::<diesel::sql_types::BigInt, _>(editgroup_id)
- .get_result(&conn)
- .unwrap();
+ ).bind::<diesel::sql_types::Nullable<diesel::sql_types::Int8>, _>(body.size)
+ .bind::<diesel::sql_types::Nullable<diesel::sql_types::Text>, _>(body.sha1)
+ .bind::<diesel::sql_types::Nullable<diesel::sql_types::Text>, _>(body.url)
+ .bind::<diesel::sql_types::BigInt, _>(editgroup_id)
+ .get_result(&conn)
+ .unwrap();
let edit = &edit;
let entity_edit = EntityEdit {
diff --git a/rust/src/database_models.rs b/rust/src/database_models.rs
index d9305e9f..8e93d69e 100644
--- a/rust/src/database_models.rs
+++ b/rust/src/database_models.rs
@@ -106,7 +106,7 @@ entity_structs!(
pub struct FileRevRow {
pub id: i64,
//extra_json: Option<String>,
- pub size: Option<i32>,
+ pub size: Option<i64>,
pub sha1: Option<String>,
pub url: Option<String>,
}
@@ -181,7 +181,7 @@ pub struct FileReleaseRow {
#[table_name = "editgroup"]
pub struct EditgroupRow {
pub id: i64,
- pub extra_json: Option<serde_json::Value>,
+ //pub extra_json: Option<serde_json::Value>,
pub editor_id: i64,
pub description: Option<String>,
}
diff --git a/rust/src/database_schema.rs b/rust/src/database_schema.rs
index 9bcedf3e..a3b9cf2f 100644
--- a/rust/src/database_schema.rs
+++ b/rust/src/database_schema.rs
@@ -64,7 +64,7 @@ table! {
table! {
editgroup (id) {
id -> Int8,
- extra_json -> Nullable<Json>,
+ //extra_json -> Nullable<Json>,
editor_id -> Int8,
description -> Nullable<Text>,
}
@@ -108,7 +108,7 @@ table! {
table! {
file_rev (id) {
id -> Int8,
- extra_json -> Nullable<Json>,
+ //extra_json -> Nullable<Json>,
size -> Nullable<Int8>,
sha1 -> Nullable<Text>,
url -> Nullable<Text>,