aboutsummaryrefslogtreecommitdiffstats
path: root/rust/src/database_models.rs
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2018-09-07 21:53:17 -0700
committerBryan Newbold <bnewbold@robocracy.org>2018-09-07 21:53:17 -0700
commita74644fe121564fb130ef1978177a39cc574e25d (patch)
tree97555359a31b91c0535a6025133c359585411a2b /rust/src/database_models.rs
parentd2070ba3718978a9615ae2aa3d81825803522a91 (diff)
downloadfatcat-a74644fe121564fb130ef1978177a39cc574e25d.tar.gz
fatcat-a74644fe121564fb130ef1978177a39cc574e25d.zip
fmt
Diffstat (limited to 'rust/src/database_models.rs')
-rw-r--r--rust/src/database_models.rs29
1 files changed, 24 insertions, 5 deletions
diff --git a/rust/src/database_models.rs b/rust/src/database_models.rs
index 2d6788eb..93e6a0fe 100644
--- a/rust/src/database_models.rs
+++ b/rust/src/database_models.rs
@@ -37,9 +37,14 @@ pub trait EntityEditRow {
// Helper for constructing tables
macro_rules! entity_structs {
- ($edit_table:expr, $edit_struct:ident, $edit_new_struct:ident, $ident_table:expr,
- $ident_struct:ident, $ident_new_struct:ident) => {
-
+ (
+ $edit_table:expr,
+ $edit_struct:ident,
+ $edit_new_struct:ident,
+ $ident_table:expr,
+ $ident_struct:ident,
+ $ident_new_struct:ident
+ ) => {
#[derive(Debug, Queryable, Identifiable, Associations, AsChangeset, QueryableByName)]
#[table_name = $edit_table]
pub struct $edit_struct {
@@ -218,7 +223,14 @@ pub struct FileRevNewRow {
pub mimetype: Option<String>,
}
-entity_structs!("file_edit", FileEditRow, FileEditNewRow, "file_ident", FileIdentRow, FileIdentNewRow);
+entity_structs!(
+ "file_edit",
+ FileEditRow,
+ FileEditNewRow,
+ "file_ident",
+ FileIdentRow,
+ FileIdentNewRow
+);
#[derive(Debug, Queryable, Identifiable, Associations, AsChangeset)]
#[table_name = "release_rev"]
@@ -289,7 +301,14 @@ pub struct WorkRevNewRow {
pub extra_json: Option<serde_json::Value>,
}
-entity_structs!("work_edit", WorkEditRow, WorkEditNewRow, "work_ident", WorkIdentRow, WorkIdentNewRow);
+entity_structs!(
+ "work_edit",
+ WorkEditRow,
+ WorkEditNewRow,
+ "work_ident",
+ WorkIdentRow,
+ WorkIdentNewRow
+);
#[derive(Debug, Queryable, Identifiable, Associations, AsChangeset)]
#[table_name = "release_rev_abstract"]