kordophone-db: switch to diesel for more features
This commit is contained in:
27
kordophone-db/src/schema.rs
Normal file
27
kordophone-db/src/schema.rs
Normal file
@@ -0,0 +1,27 @@
|
||||
diesel::table! {
|
||||
conversations (id) {
|
||||
id -> Text,
|
||||
unread_count -> BigInt,
|
||||
display_name -> Nullable<Text>,
|
||||
last_message_preview -> Nullable<Text>,
|
||||
date -> Timestamp,
|
||||
}
|
||||
}
|
||||
|
||||
diesel::table! {
|
||||
participants (id) {
|
||||
id -> Integer,
|
||||
display_name -> Text,
|
||||
}
|
||||
}
|
||||
|
||||
diesel::table! {
|
||||
conversation_participants (conversation_id, participant_id) {
|
||||
conversation_id -> Text,
|
||||
participant_id -> Integer,
|
||||
}
|
||||
}
|
||||
|
||||
diesel::joinable!(conversation_participants -> conversations (conversation_id));
|
||||
diesel::joinable!(conversation_participants -> participants (participant_id));
|
||||
diesel::allow_tables_to_appear_in_same_query!(conversations, participants, conversation_participants);
|
||||
Reference in New Issue
Block a user