diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2018-05-24 01:31:44 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2018-05-24 15:21:32 -0700 |
commit | 63db335123d8dde1c4e701668c07805094ff88e8 (patch) | |
tree | 83f0387b6568d09c525330d414b8e21c21d43e03 /rust/src/database_models.rs | |
parent | eb094c1829d1fc9bb48e687921eeff656b69e2c2 (diff) | |
download | fatcat-63db335123d8dde1c4e701668c07805094ff88e8.tar.gz fatcat-63db335123d8dde1c4e701668c07805094ff88e8.zip |
WIP on API spec improvements
Fixes a bunch of i64/i32/isize stuff
Diffstat (limited to 'rust/src/database_models.rs')
-rw-r--r-- | rust/src/database_models.rs | 16 |
1 files changed, 8 insertions, 8 deletions
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<i64>, pub redirect_id: Option<Uuid>, pub editgroup_id: i64, - //pub extra_json: Option<String>, + //pub extra_json: Option<serde_json::Value>, } #[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<Json>, + //extra_json: Option<String>, pub name: String, pub orcid: Option<String>, } @@ -105,7 +105,7 @@ entity_structs!( #[table_name = "file_rev"] pub struct FileRevRow { pub id: i64, - //extra_json: Option<Json>, + //extra_json: Option<String>, pub size: Option<i32>, pub sha1: Option<String>, pub url: Option<String>, @@ -181,7 +181,7 @@ pub struct FileReleaseRow { #[table_name = "editgroup"] pub struct EditgroupRow { pub id: i64, - //extra_json: Option<Json>, + pub extra_json: Option<serde_json::Value>, pub editor_id: i64, pub description: Option<String>, } |