Plume/src/schema.rs

59 lines
1.1 KiB
Rust
Raw Normal View History

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,
}
}
table! {
instances (id) {
id -> Int4,
local_domain -> Varchar,
public_domain -> Varchar,
name -> Varchar,
local -> Bool,
blocked -> Bool,
}
}
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-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-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-04-22 20:13:12 +02:00
instances,
users,
);