2018-04-23 13:27:27 +02:00
|
|
|
table! {
|
|
|
|
blog_authors (id) {
|
|
|
|
id -> Int4,
|
|
|
|
blog_id -> Int4,
|
|
|
|
author_id -> Int4,
|
|
|
|
is_owner -> Bool,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-04-23 12:29:27 +02: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 19:46:27 +02:00
|
|
|
creation_date -> Timestamp,
|
2018-05-01 20:02:29 +02:00
|
|
|
ap_url -> Text,
|
2018-05-03 21:11:04 +02:00
|
|
|
private_key -> Nullable<Text>,
|
|
|
|
public_key -> Text,
|
2018-04-23 12:29:27 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-05-09 22:35:02 +02:00
|
|
|
table! {
|
|
|
|
comments (id) {
|
|
|
|
id -> Int4,
|
|
|
|
content -> Text,
|
|
|
|
in_response_to_id -> Nullable<Int4>,
|
|
|
|
post_id -> Int4,
|
|
|
|
author_id -> Int4,
|
|
|
|
creation_date -> Timestamp,
|
|
|
|
ap_url -> Nullable<Varchar>,
|
|
|
|
sensitive -> Bool,
|
|
|
|
spoiler_text -> Text,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-05-01 15:06:31 +02:00
|
|
|
table! {
|
|
|
|
follows (id) {
|
|
|
|
id -> Int4,
|
|
|
|
follower_id -> Int4,
|
|
|
|
following_id -> Int4,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-04-22 15:35:37 +02:00
|
|
|
table! {
|
|
|
|
instances (id) {
|
|
|
|
id -> Int4,
|
|
|
|
public_domain -> Varchar,
|
|
|
|
name -> Varchar,
|
|
|
|
local -> Bool,
|
|
|
|
blocked -> Bool,
|
2018-04-30 19:46:27 +02:00
|
|
|
creation_date -> Timestamp,
|
2018-04-22 15:35:37 +02:00
|
|
|
}
|
|
|
|
}
|
2018-04-22 20:13:12 +02:00
|
|
|
|
2018-05-10 17:54:35 +02:00
|
|
|
table! {
|
|
|
|
likes (id) {
|
|
|
|
id -> Int4,
|
|
|
|
user_id -> Int4,
|
|
|
|
post_id -> Int4,
|
|
|
|
creation_date -> Timestamp,
|
2018-05-13 12:44:05 +02:00
|
|
|
ap_url -> Varchar,
|
2018-05-10 17:54:35 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-20 20:22:34 +02:00
|
|
|
table! {
|
|
|
|
mentions (id) {
|
|
|
|
id -> Int4,
|
|
|
|
mentioned_id -> Int4,
|
|
|
|
post_id -> Nullable<Int4>,
|
|
|
|
comment_id -> Nullable<Int4>,
|
2018-06-20 22:05:30 +02:00
|
|
|
ap_url -> Varchar,
|
2018-06-20 20:22:34 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-05-13 14:44:18 +02:00
|
|
|
table! {
|
|
|
|
notifications (id) {
|
|
|
|
id -> Int4,
|
|
|
|
user_id -> Int4,
|
2018-05-24 12:12:27 +02:00
|
|
|
creation_date -> Timestamp,
|
2018-07-26 15:46:10 +02:00
|
|
|
kind -> Varchar,
|
|
|
|
object_id -> Int4,
|
2018-05-13 14:44:18 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-04-23 16:37:49 +02:00
|
|
|
table! {
|
|
|
|
post_authors (id) {
|
|
|
|
id -> Int4,
|
|
|
|
post_id -> Int4,
|
|
|
|
author_id -> Int4,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-04-23 15:41:43 +02:00
|
|
|
table! {
|
|
|
|
posts (id) {
|
|
|
|
id -> Int4,
|
|
|
|
blog_id -> Int4,
|
|
|
|
slug -> Varchar,
|
|
|
|
title -> Varchar,
|
|
|
|
content -> Text,
|
|
|
|
published -> Bool,
|
|
|
|
license -> Varchar,
|
2018-04-30 19:46:27 +02:00
|
|
|
creation_date -> Timestamp,
|
2018-05-10 12:52:56 +02:00
|
|
|
ap_url -> Varchar,
|
2018-04-23 15:41:43 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-05-19 11:23:02 +02:00
|
|
|
table! {
|
|
|
|
reshares (id) {
|
|
|
|
id -> Int4,
|
|
|
|
user_id -> Int4,
|
|
|
|
post_id -> Int4,
|
|
|
|
ap_url -> Varchar,
|
|
|
|
creation_date -> Timestamp,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-04-22 20:13:12 +02: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 19:46:27 +02:00
|
|
|
creation_date -> Timestamp,
|
2018-05-01 20:02:29 +02:00
|
|
|
ap_url -> Text,
|
2018-05-03 19:12:01 +02:00
|
|
|
private_key -> Nullable<Text>,
|
|
|
|
public_key -> Text,
|
2018-05-13 20:12:27 +02:00
|
|
|
shared_inbox_url -> Nullable<Varchar>,
|
2018-07-27 12:53:21 +02:00
|
|
|
followers_endpoint -> Varchar,
|
2018-04-22 20:13:12 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-04-23 13:27:27 +02:00
|
|
|
joinable!(blog_authors -> blogs (blog_id));
|
|
|
|
joinable!(blog_authors -> users (author_id));
|
2018-04-23 12:29:27 +02:00
|
|
|
joinable!(blogs -> instances (instance_id));
|
2018-05-09 22:35:02 +02:00
|
|
|
joinable!(comments -> posts (post_id));
|
|
|
|
joinable!(comments -> users (author_id));
|
2018-05-10 17:54:35 +02:00
|
|
|
joinable!(likes -> posts (post_id));
|
|
|
|
joinable!(likes -> users (user_id));
|
2018-06-20 20:22:34 +02:00
|
|
|
joinable!(mentions -> comments (comment_id));
|
|
|
|
joinable!(mentions -> posts (post_id));
|
|
|
|
joinable!(mentions -> users (mentioned_id));
|
2018-05-13 14:44:18 +02:00
|
|
|
joinable!(notifications -> users (user_id));
|
2018-04-23 16:37:49 +02:00
|
|
|
joinable!(post_authors -> posts (post_id));
|
|
|
|
joinable!(post_authors -> users (author_id));
|
2018-04-23 15:41:43 +02:00
|
|
|
joinable!(posts -> blogs (blog_id));
|
2018-05-19 11:23:02 +02:00
|
|
|
joinable!(reshares -> posts (post_id));
|
|
|
|
joinable!(reshares -> users (user_id));
|
2018-04-22 20:13:12 +02:00
|
|
|
joinable!(users -> instances (instance_id));
|
|
|
|
|
|
|
|
allow_tables_to_appear_in_same_query!(
|
2018-04-23 13:27:27 +02:00
|
|
|
blog_authors,
|
2018-04-23 12:29:27 +02:00
|
|
|
blogs,
|
2018-05-09 22:35:02 +02:00
|
|
|
comments,
|
2018-05-01 15:06:31 +02:00
|
|
|
follows,
|
2018-04-22 20:13:12 +02:00
|
|
|
instances,
|
2018-05-10 17:54:35 +02:00
|
|
|
likes,
|
2018-06-20 20:22:34 +02:00
|
|
|
mentions,
|
2018-05-13 14:44:18 +02:00
|
|
|
notifications,
|
2018-04-23 16:37:49 +02:00
|
|
|
post_authors,
|
2018-04-23 15:41:43 +02:00
|
|
|
posts,
|
2018-05-19 11:23:02 +02:00
|
|
|
reshares,
|
2018-04-22 20:13:12 +02:00
|
|
|
users,
|
|
|
|
);
|