Plume/src/schema.rs

98 lines
1.9 KiB
Rust
Raw Normal View History

2018-04-23 11:27:27 +00:00
table! {
blog_authors (id) {
id -> Int4,
blog_id -> Int4,
author_id -> Int4,
is_owner -> Bool,
}
}
2018-04-23 10:29:27 +00:00
table! {
blogs (id) {
id -> Int4,
actor_id -> Varchar,
title -> Varchar,
summary -> Text,
outbox_url -> Varchar,
inbox_url -> Varchar,
instance_id -> Int4,
2018-04-30 17:46:27 +00:00
creation_date -> Timestamp,
2018-05-01 18:02:29 +00:00
ap_url -> Text,
2018-04-23 10:29:27 +00:00
}
}
2018-05-01 13:06:31 +00:00
table! {
follows (id) {
id -> Int4,
follower_id -> Int4,
following_id -> Int4,
}
}
table! {
instances (id) {
id -> Int4,
public_domain -> Varchar,
name -> Varchar,
local -> Bool,
blocked -> Bool,
2018-04-30 17:46:27 +00:00
creation_date -> Timestamp,
}
}
2018-04-22 18:13:12 +00:00
2018-04-23 14:37:49 +00:00
table! {
post_authors (id) {
id -> Int4,
post_id -> Int4,
author_id -> Int4,
}
}
2018-04-23 13:41:43 +00:00
table! {
posts (id) {
id -> Int4,
blog_id -> Int4,
slug -> Varchar,
title -> Varchar,
content -> Text,
published -> Bool,
license -> Varchar,
2018-04-30 17:46:27 +00:00
creation_date -> Timestamp,
2018-04-23 13:41:43 +00:00
}
}
2018-04-22 18:13:12 +00:00
table! {
users (id) {
id -> Int4,
username -> Varchar,
display_name -> Varchar,
outbox_url -> Varchar,
inbox_url -> Varchar,
is_admin -> Bool,
summary -> Text,
email -> Nullable<Text>,
hashed_password -> Nullable<Text>,
instance_id -> Int4,
2018-04-30 17:46:27 +00:00
creation_date -> Timestamp,
2018-05-01 18:02:29 +00:00
ap_url -> Text,
2018-04-22 18:13:12 +00:00
}
}
2018-04-23 11:27:27 +00:00
joinable!(blog_authors -> blogs (blog_id));
joinable!(blog_authors -> users (author_id));
2018-04-23 10:29:27 +00:00
joinable!(blogs -> instances (instance_id));
2018-04-23 14:37:49 +00:00
joinable!(post_authors -> posts (post_id));
joinable!(post_authors -> users (author_id));
2018-04-23 13:41:43 +00:00
joinable!(posts -> blogs (blog_id));
2018-04-22 18:13:12 +00:00
joinable!(users -> instances (instance_id));
allow_tables_to_appear_in_same_query!(
2018-04-23 11:27:27 +00:00
blog_authors,
2018-04-23 10:29:27 +00:00
blogs,
2018-05-01 13:06:31 +00:00
follows,
2018-04-22 18:13:12 +00:00
instances,
2018-04-23 14:37:49 +00:00
post_authors,
2018-04-23 13:41:43 +00:00
posts,
2018-04-22 18:13:12 +00:00
users,
);