aboutsummaryrefslogtreecommitdiffstats
path: root/rust/src
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2018-05-14 22:01:26 -0700
committerBryan Newbold <bnewbold@robocracy.org>2018-05-14 22:01:35 -0700
commite468707ee53f4a8ff75b00a1eec44921672464b6 (patch)
tree4aa5ba8b5f044eabcbb6d4dffd94502f8e614ea8 /rust/src
parent6ca8ff2abdc3601e3da1f53a5562d96d3af1aac3 (diff)
downloadfatcat-e468707ee53f4a8ff75b00a1eec44921672464b6.tar.gz
fatcat-e468707ee53f4a8ff75b00a1eec44921672464b6.zip
commit older files
Diffstat (limited to 'rust/src')
-rw-r--r--rust/src/bin/show_creators.rs6
-rw-r--r--rust/src/database_schema.rs68
2 files changed, 71 insertions, 3 deletions
diff --git a/rust/src/bin/show_creators.rs b/rust/src/bin/show_creators.rs
index 160ca3c7..968d2542 100644
--- a/rust/src/bin/show_creators.rs
+++ b/rust/src/bin/show_creators.rs
@@ -1,13 +1,13 @@
-extern crate fc;
+extern crate fatcat;
extern crate diesel;
-use self::fatcat_rs::*;
+use self::fatcat::*;
use self::models::*;
use self::diesel::prelude::*;
fn main() {
- use diesel_demo::schema::creators::dsl::*;
+ use diesel_demo::database_schema::creators::dsl::*;
let connection = establish_connection();
let results = creators.filter(published.eq(true))
diff --git a/rust/src/database_schema.rs b/rust/src/database_schema.rs
new file mode 100644
index 00000000..7bef7dcd
--- /dev/null
+++ b/rust/src/database_schema.rs
@@ -0,0 +1,68 @@
+table! {
+ changelog (id) {
+ id -> Int8,
+ editgroup_id -> Int8,
+ timestamp -> Nullable<Timestamp>,
+ }
+}
+
+table! {
+ creator_edit (id) {
+ id -> Int8,
+ extra_json -> Nullable<Json>,
+ ident_id -> Uuid,
+ rev_id -> Nullable<Int8>,
+ redirect_id -> Nullable<Uuid>,
+ editgroup_id -> Int8,
+ }
+}
+
+table! {
+ creator_ident (id) {
+ id -> Uuid,
+ is_live -> Bool,
+ rev_id -> Nullable<Int8>,
+ redirect_id -> Nullable<Uuid>,
+ }
+}
+
+table! {
+ creator_rev (id) {
+ id -> Int8,
+ extra_json -> Nullable<Json>,
+ name -> Nullable<Text>,
+ orcid -> Nullable<Text>,
+ }
+}
+
+table! {
+ editgroup (id) {
+ id -> Int8,
+ extra_json -> Nullable<Json>,
+ editor_id -> Int8,
+ description -> Nullable<Text>,
+ }
+}
+
+table! {
+ editor (id) {
+ id -> Int8,
+ username -> Text,
+ is_admin -> Bool,
+ active_editgroup_id -> Nullable<Int8>,
+ }
+}
+
+joinable!(changelog -> editgroup (editgroup_id));
+joinable!(creator_edit -> creator_rev (rev_id));
+joinable!(creator_edit -> editgroup (editgroup_id));
+joinable!(creator_ident -> creator_rev (rev_id));
+
+allow_tables_to_appear_in_same_query!(
+ changelog,
+ creator_edit,
+ creator_ident,
+ creator_rev,
+ editgroup,
+ editor,
+);