aboutsummaryrefslogtreecommitdiffstats
path: root/rust/src/database_schema.rs
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2018-07-24 02:10:36 -0700
committerBryan Newbold <bnewbold@robocracy.org>2018-07-24 02:10:36 -0700
commit5a7e60632e41c7f6b7ae0b7e3ab413209c88ea4b (patch)
treea1710ea413f9a34ef6864dd4fd7501a5ed82fd1a /rust/src/database_schema.rs
parent4720becd96ea298dfcfcdfb61a2fad7eba4ba670 (diff)
downloadfatcat-5a7e60632e41c7f6b7ae0b7e3ab413209c88ea4b.tar.gz
fatcat-5a7e60632e41c7f6b7ae0b7e3ab413209c88ea4b.zip
partial implementation of new API features
Diffstat (limited to 'rust/src/database_schema.rs')
-rw-r--r--rust/src/database_schema.rs75
1 files changed, 58 insertions, 17 deletions
diff --git a/rust/src/database_schema.rs b/rust/src/database_schema.rs
index d99fdd3f..c23e3f83 100644
--- a/rust/src/database_schema.rs
+++ b/rust/src/database_schema.rs
@@ -1,4 +1,11 @@
table! {
+ abstracts (sha1) {
+ sha1 -> Bpchar,
+ content -> Text,
+ }
+}
+
+table! {
changelog (id) {
id -> Int8,
editgroup_id -> Uuid,
@@ -10,9 +17,11 @@ table! {
container_edit (id) {
id -> Int8,
editgroup_id -> Uuid,
+ updated -> Timestamp,
ident_id -> Uuid,
rev_id -> Nullable<Uuid>,
redirect_id -> Nullable<Uuid>,
+ prev_rev -> Nullable<Uuid>,
extra_json -> Nullable<Json>,
}
}
@@ -32,7 +41,8 @@ table! {
extra_json -> Nullable<Json>,
name -> Text,
publisher -> Nullable<Text>,
- issnl -> Nullable<Text>,
+ issnl -> Nullable<Bpchar>,
+ wikidata_qid -> Nullable<Text>,
abbrev -> Nullable<Text>,
coden -> Nullable<Text>,
}
@@ -42,9 +52,11 @@ table! {
creator_edit (id) {
id -> Int8,
editgroup_id -> Uuid,
+ updated -> Timestamp,
ident_id -> Uuid,
rev_id -> Nullable<Uuid>,
redirect_id -> Nullable<Uuid>,
+ prev_rev -> Nullable<Uuid>,
extra_json -> Nullable<Json>,
}
}
@@ -65,15 +77,17 @@ table! {
display_name -> Text,
given_name -> Nullable<Text>,
surname -> Nullable<Text>,
- orcid -> Nullable<Text>,
+ orcid -> Nullable<Bpchar>,
+ wikidata_qid -> Nullable<Text>,
}
}
table! {
editgroup (id) {
id -> Uuid,
- extra_json -> Nullable<Json>,
editor_id -> Uuid,
+ created -> Timestamp,
+ extra_json -> Nullable<Json>,
description -> Nullable<Text>,
}
}
@@ -83,6 +97,7 @@ table! {
id -> Uuid,
username -> Text,
is_admin -> Bool,
+ registered -> Timestamp,
active_editgroup_id -> Nullable<Uuid>,
}
}
@@ -91,9 +106,11 @@ table! {
file_edit (id) {
id -> Int8,
editgroup_id -> Uuid,
+ updated -> Timestamp,
ident_id -> Uuid,
rev_id -> Nullable<Uuid>,
redirect_id -> Nullable<Uuid>,
+ prev_rev -> Nullable<Uuid>,
extra_json -> Nullable<Json>,
}
}
@@ -119,22 +136,31 @@ table! {
id -> Uuid,
extra_json -> Nullable<Json>,
size -> Nullable<Int8>,
- sha1 -> Nullable<Text>,
- sha256 -> Nullable<Text>,
- md5 -> Nullable<Text>,
- url -> Nullable<Text>,
+ sha1 -> Nullable<Bpchar>,
+ sha256 -> Nullable<Bpchar>,
+ md5 -> Nullable<Bpchar>,
mimetype -> Nullable<Text>,
}
}
table! {
+ file_rev_url (id) {
+ id -> Int8,
+ file_rev -> Uuid,
+ rel -> Text,
+ url -> Text,
+ }
+}
+
+table! {
release_contrib (id) {
id -> Int8,
release_rev -> Uuid,
creator_ident_id -> Nullable<Uuid>,
+ raw -> Nullable<Text>,
role -> Nullable<Text>,
index -> Nullable<Int8>,
- raw -> Nullable<Text>,
+ extra_json -> Nullable<Json>,
}
}
@@ -142,9 +168,11 @@ table! {
release_edit (id) {
id -> Int8,
editgroup_id -> Uuid,
+ updated -> Timestamp,
ident_id -> Uuid,
rev_id -> Nullable<Uuid>,
redirect_id -> Nullable<Uuid>,
+ prev_rev -> Nullable<Uuid>,
extra_json -> Nullable<Json>,
}
}
@@ -165,7 +193,7 @@ table! {
target_release_ident_id -> Nullable<Uuid>,
index -> Nullable<Int8>,
key -> Nullable<Text>,
- raw -> Nullable<Text>,
+ extra_json -> Nullable<Json>,
container_title -> Nullable<Text>,
year -> Nullable<Int8>,
title -> Nullable<Text>,
@@ -184,6 +212,9 @@ table! {
release_status -> Nullable<Text>,
release_date -> Nullable<Date>,
doi -> Nullable<Text>,
+ pmid -> Nullable<Text>,
+ pmcid -> Nullable<Text>,
+ wikidata_qid -> Nullable<Text>,
isbn13 -> Nullable<Text>,
volume -> Nullable<Text>,
issue -> Nullable<Text>,
@@ -194,12 +225,24 @@ table! {
}
table! {
+ release_rev_abstract (id) {
+ id -> Int8,
+ release_rev -> Uuid,
+ abstract_sha1 -> Bpchar,
+ mimetype -> Nullable<Text>,
+ lang -> Nullable<Text>,
+ }
+}
+
+table! {
work_edit (id) {
id -> Int8,
editgroup_id -> Uuid,
+ updated -> Timestamp,
ident_id -> Uuid,
rev_id -> Nullable<Uuid>,
redirect_id -> Nullable<Uuid>,
+ prev_rev -> Nullable<Uuid>,
extra_json -> Nullable<Json>,
}
}
@@ -217,38 +260,34 @@ table! {
work_rev (id) {
id -> Uuid,
extra_json -> Nullable<Json>,
- work_type -> Nullable<Text>,
- primary_release_id -> Nullable<Uuid>,
}
}
joinable!(changelog -> editgroup (editgroup_id));
-joinable!(container_edit -> container_rev (rev_id));
joinable!(container_edit -> editgroup (editgroup_id));
joinable!(container_ident -> container_rev (rev_id));
-joinable!(creator_edit -> creator_rev (rev_id));
joinable!(creator_edit -> editgroup (editgroup_id));
joinable!(creator_ident -> creator_rev (rev_id));
joinable!(file_edit -> editgroup (editgroup_id));
-joinable!(file_edit -> file_rev (rev_id));
joinable!(file_ident -> file_rev (rev_id));
joinable!(file_release -> file_rev (file_rev));
joinable!(file_release -> release_ident (target_release_ident_id));
+joinable!(file_rev_url -> file_rev (file_rev));
joinable!(release_contrib -> creator_ident (creator_ident_id));
joinable!(release_contrib -> release_rev (release_rev));
joinable!(release_edit -> editgroup (editgroup_id));
-joinable!(release_edit -> release_rev (rev_id));
joinable!(release_ident -> release_rev (rev_id));
joinable!(release_ref -> release_ident (target_release_ident_id));
joinable!(release_ref -> release_rev (release_rev));
joinable!(release_rev -> container_ident (container_ident_id));
joinable!(release_rev -> work_ident (work_ident_id));
+joinable!(release_rev_abstract -> abstracts (abstract_sha1));
+joinable!(release_rev_abstract -> release_rev (release_rev));
joinable!(work_edit -> editgroup (editgroup_id));
-joinable!(work_edit -> work_rev (rev_id));
joinable!(work_ident -> work_rev (rev_id));
-joinable!(work_rev -> release_ident (primary_release_id));
allow_tables_to_appear_in_same_query!(
+ abstracts,
changelog,
container_edit,
container_ident,
@@ -262,11 +301,13 @@ allow_tables_to_appear_in_same_query!(
file_ident,
file_release,
file_rev,
+ file_rev_url,
release_contrib,
release_edit,
release_ident,
release_ref,
release_rev,
+ release_rev_abstract,
work_edit,
work_ident,
work_rev,