aboutsummaryrefslogtreecommitdiffstats
path: root/rust
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2018-08-14 21:02:18 -0700
committerBryan Newbold <bnewbold@robocracy.org>2018-08-14 21:02:18 -0700
commit602d0ff2598b6ac15766689c925aff818c029615 (patch)
treed11c4f4c3ff39fa04f22f30fb7763a1a1cb35a4f /rust
parent987b41fd721231bc320a5f562d9a1c526db01079 (diff)
downloadfatcat-602d0ff2598b6ac15766689c925aff818c029615.tar.gz
fatcat-602d0ff2598b6ac15766689c925aff818c029615.zip
index_val and role_val
Diffstat (limited to 'rust')
-rw-r--r--rust/src/api_server.rs16
-rw-r--r--rust/src/database_models.rs12
-rw-r--r--rust/src/database_schema.rs6
3 files changed, 17 insertions, 17 deletions
diff --git a/rust/src/api_server.rs b/rust/src/api_server.rs
index f7866b68..10587d08 100644
--- a/rust/src/api_server.rs
+++ b/rust/src/api_server.rs
@@ -198,12 +198,12 @@ fn release_row2entity(
let refs: Vec<ReleaseRef> = release_ref::table
.filter(release_ref::release_rev.eq(rev.id))
- .order(release_ref::index.asc())
+ .order(release_ref::index_val.asc())
.get_results(conn)
.expect("fetch release refs")
.into_iter()
.map(|r: ReleaseRefRow| ReleaseRef {
- index: r.index,
+ index: r.index_val,
key: r.key,
extra: r.extra_json,
container_title: r.container_title,
@@ -216,14 +216,14 @@ fn release_row2entity(
let contribs: Vec<ReleaseContrib> = release_contrib::table
.filter(release_contrib::release_rev.eq(rev.id))
- .order((release_contrib::role.asc(), release_contrib::index.asc()))
+ .order((release_contrib::role_val.asc(), release_contrib::index_val.asc()))
.get_results(conn)
.expect("fetch release refs")
.into_iter()
.map(|c: ReleaseContribRow| ReleaseContrib {
- index: c.index,
+ index: c.index_val,
raw_name: c.raw_name,
- role: c.role,
+ role: c.role_val,
extra: c.extra_json,
creator_id: c.creator_ident_id.map(|v| uuid2fcid(&v)),
creator: None,
@@ -729,7 +729,7 @@ impl Server {
target_release_ident_id: r.target_release_id
.clone()
.map(|v| fcid2uuid(&v).expect("valid fatcat identifier")),
- index: r.index,
+ index_val: r.index,
key: r.key.clone(),
container_title: r.container_title.clone(),
year: r.year,
@@ -761,8 +761,8 @@ impl Server {
.clone()
.map(|v| fcid2uuid(&v).expect("valid fatcat identifier")),
raw_name: c.raw_name.clone(),
- index: c.index,
- role: c.role.clone(),
+ index_val: c.index,
+ role_val: c.role.clone(),
extra_json: c.extra.clone(),
})
.collect();
diff --git a/rust/src/database_models.rs b/rust/src/database_models.rs
index 258bcab7..c7da4de7 100644
--- a/rust/src/database_models.rs
+++ b/rust/src/database_models.rs
@@ -227,8 +227,8 @@ pub struct ReleaseContribRow {
pub release_rev: Uuid,
pub creator_ident_id: Option<Uuid>,
pub raw_name: Option<String>,
- pub role: Option<String>,
- pub index: Option<i64>,
+ pub role_val: Option<String>,
+ pub index_val: Option<i64>,
pub extra_json: Option<serde_json::Value>,
}
@@ -238,8 +238,8 @@ pub struct ReleaseContribNewRow {
pub release_rev: Uuid,
pub creator_ident_id: Option<Uuid>,
pub raw_name: Option<String>,
- pub role: Option<String>,
- pub index: Option<i64>,
+ pub role_val: Option<String>,
+ pub index_val: Option<i64>,
pub extra_json: Option<serde_json::Value>,
}
@@ -249,7 +249,7 @@ pub struct ReleaseRefRow {
pub id: i64,
pub release_rev: Uuid,
pub target_release_ident_id: Option<Uuid>,
- pub index: Option<i64>,
+ pub index_val: Option<i64>,
pub key: Option<String>,
pub extra_json: Option<serde_json::Value>,
pub container_title: Option<String>,
@@ -263,7 +263,7 @@ pub struct ReleaseRefRow {
pub struct ReleaseRefNewRow {
pub release_rev: Uuid,
pub target_release_ident_id: Option<Uuid>,
- pub index: Option<i64>,
+ pub index_val: Option<i64>,
pub key: Option<String>,
pub extra_json: Option<serde_json::Value>,
pub container_title: Option<String>,
diff --git a/rust/src/database_schema.rs b/rust/src/database_schema.rs
index 3a8fe901..d6084ab9 100644
--- a/rust/src/database_schema.rs
+++ b/rust/src/database_schema.rs
@@ -158,8 +158,8 @@ table! {
release_rev -> Uuid,
creator_ident_id -> Nullable<Uuid>,
raw_name -> Nullable<Text>,
- role -> Nullable<Text>,
- index -> Nullable<Int8>,
+ role_val -> Nullable<Text>,
+ index_val -> Nullable<Int8>,
extra_json -> Nullable<Json>,
}
}
@@ -191,7 +191,7 @@ table! {
id -> Int8,
release_rev -> Uuid,
target_release_ident_id -> Nullable<Uuid>,
- index -> Nullable<Int8>,
+ index_val -> Nullable<Int8>,
key -> Nullable<Text>,
extra_json -> Nullable<Json>,
container_title -> Nullable<Text>,