From 63db335123d8dde1c4e701668c07805094ff88e8 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Thu, 24 May 2018 01:31:44 -0700 Subject: WIP on API spec improvements Fixes a bunch of i64/i32/isize stuff --- rust/src/database_models.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'rust/src/database_models.rs') diff --git a/rust/src/database_models.rs b/rust/src/database_models.rs index 0e138439..33676c95 100644 --- a/rust/src/database_models.rs +++ b/rust/src/database_models.rs @@ -1,8 +1,8 @@ use chrono; -//use serde_json; use database_schema::*; -use uuid::Uuid; use errors::*; +use serde_json; +use uuid::Uuid; // Ugh. I thought the whole point was to *not* do this, but: // https://github.com/diesel-rs/diesel/issues/1589 @@ -19,7 +19,7 @@ impl EntityState { match self { EntityState::WorkInProgress => "wip", EntityState::Active(_) => "active", - EntityState::Redirect(_,_) => "redirect", + EntityState::Redirect(_, _) => "redirect", EntityState::Deleted => "deleted", }.to_string() } @@ -40,7 +40,7 @@ macro_rules! entity_structs { pub rev_id: Option, pub redirect_id: Option, pub editgroup_id: i64, - //pub extra_json: Option, + //pub extra_json: Option, } #[derive(Debug, Queryable, Identifiable, Associations, AsChangeset)] @@ -61,7 +61,7 @@ macro_rules! entity_structs { (None, None) => Ok(EntityState::Deleted), (Some(redir), Some(rev)) => Ok(EntityState::Redirect(redir, rev)), (None, Some(rev)) => Ok(EntityState::Active(rev)), - _ => bail!("Invalid EntityIdentRow state") + _ => bail!("Invalid EntityIdentRow state"), } } } @@ -89,7 +89,7 @@ entity_structs!( #[table_name = "creator_rev"] pub struct CreatorRevRow { pub id: i64, - //extra_json: Option, + //extra_json: Option, pub name: String, pub orcid: Option, } @@ -105,7 +105,7 @@ entity_structs!( #[table_name = "file_rev"] pub struct FileRevRow { pub id: i64, - //extra_json: Option, + //extra_json: Option, pub size: Option, pub sha1: Option, pub url: Option, @@ -181,7 +181,7 @@ pub struct FileReleaseRow { #[table_name = "editgroup"] pub struct EditgroupRow { pub id: i64, - //extra_json: Option, + pub extra_json: Option, pub editor_id: i64, pub description: Option, } -- cgit v1.2.3