Skip to content

Commit

Permalink
update schema
Browse files Browse the repository at this point in the history
  • Loading branch information
aumetra committed Jun 1, 2024
1 parent ed9355c commit 8bdc05c
Showing 1 changed file with 147 additions and 58 deletions.
205 changes: 147 additions & 58 deletions crates/kitsune-db/src/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,18 @@ diesel::table! {
///
/// (Automatically generated by Diesel.)
id -> Uuid,
/// The `avatar_id` column of the `accounts` table.
///
/// Its SQL type is `Nullable<Uuid>`.
///
/// (Automatically generated by Diesel.)
avatar_id -> Nullable<Uuid>,
/// The `header_id` column of the `accounts` table.
///
/// Its SQL type is `Nullable<Uuid>`.
///
/// (Automatically generated by Diesel.)
header_id -> Nullable<Uuid>,
/// The `display_name` column of the `accounts` table.
///
/// Its SQL type is `Nullable<Text>`.
Expand Down Expand Up @@ -62,96 +74,118 @@ diesel::table! {
///
/// (Automatically generated by Diesel.)
domain -> Text,
/// The `actor_type` column of the `accounts` table.
/// The `account_type` column of the `accounts` table.
///
/// Its SQL type is `Int4`.
///
/// (Automatically generated by Diesel.)
actor_type -> Int4,
account_type -> Int4,
/// The `url` column of the `accounts` table.
///
/// Its SQL type is `Text`.
///
/// (Automatically generated by Diesel.)
url -> Text,
/// The `featured_collection_url` column of the `accounts` table.
/// The `created_at` column of the `accounts` table.
///
/// Its SQL type is `Nullable<Text>`.
/// Its SQL type is `Timestamptz`.
///
/// (Automatically generated by Diesel.)
featured_collection_url -> Nullable<Text>,
/// The `followers_url` column of the `accounts` table.
created_at -> Timestamptz,
/// The `updated_at` column of the `accounts` table.
///
/// Its SQL type is `Nullable<Text>`.
/// Its SQL type is `Timestamptz`.
///
/// (Automatically generated by Diesel.)
followers_url -> Nullable<Text>,
/// The `following_url` column of the `accounts` table.
updated_at -> Timestamptz,
/// The `account_ts` column of the `accounts` table.
///
/// Its SQL type is `Nullable<Text>`.
/// Its SQL type is `Tsvector`.
///
/// (Automatically generated by Diesel.)
following_url -> Nullable<Text>,
/// The `inbox_url` column of the `accounts` table.
account_ts -> Tsvector,
}
}

diesel::table! {
use diesel::sql_types::*;
use diesel_full_text_search::Tsvector;

/// Representation of the `accounts_activitypub` table.
///
/// (Automatically generated by Diesel.)
accounts_activitypub (account_id) {
/// The `account_id` column of the `accounts_activitypub` table.
///
/// Its SQL type is `Nullable<Text>`.
/// Its SQL type is `Uuid`.
///
/// (Automatically generated by Diesel.)
inbox_url -> Nullable<Text>,
/// The `outbox_url` column of the `accounts` table.
account_id -> Uuid,
/// The `featured_collection_url` column of the `accounts_activitypub` table.
///
/// Its SQL type is `Nullable<Text>`.
///
/// (Automatically generated by Diesel.)
outbox_url -> Nullable<Text>,
/// The `shared_inbox_url` column of the `accounts` table.
featured_collection_url -> Nullable<Text>,
/// The `followers_url` column of the `accounts_activitypub` table.
///
/// Its SQL type is `Nullable<Text>`.
///
/// (Automatically generated by Diesel.)
shared_inbox_url -> Nullable<Text>,
/// The `public_key_id` column of the `accounts` table.
followers_url -> Nullable<Text>,
/// The `following_url` column of the `accounts_activitypub` table.
///
/// Its SQL type is `Text`.
/// Its SQL type is `Nullable<Text>`.
///
/// (Automatically generated by Diesel.)
public_key_id -> Text,
/// The `public_key` column of the `accounts` table.
following_url -> Nullable<Text>,
/// The `inbox_url` column of the `accounts_activitypub` table.
///
/// Its SQL type is `Text`.
/// Its SQL type is `Nullable<Text>`.
///
/// (Automatically generated by Diesel.)
public_key -> Text,
/// The `created_at` column of the `accounts` table.
inbox_url -> Nullable<Text>,
/// The `outbox_url` column of the `accounts_activitypub` table.
///
/// Its SQL type is `Timestamptz`.
/// Its SQL type is `Nullable<Text>`.
///
/// (Automatically generated by Diesel.)
created_at -> Timestamptz,
/// The `updated_at` column of the `accounts` table.
outbox_url -> Nullable<Text>,
/// The `shared_inbox_url` column of the `accounts_activitypub` table.
///
/// Its SQL type is `Timestamptz`.
/// Its SQL type is `Nullable<Text>`.
///
/// (Automatically generated by Diesel.)
updated_at -> Timestamptz,
/// The `account_ts` column of the `accounts` table.
shared_inbox_url -> Nullable<Text>,
/// The `key_id` column of the `accounts_activitypub` table.
///
/// Its SQL type is `Tsvector`.
/// Its SQL type is `Text`.
///
/// (Automatically generated by Diesel.)
account_ts -> Tsvector,
/// The `avatar_id` column of the `accounts` table.
key_id -> Text,
}
}

diesel::table! {
use diesel::sql_types::*;
use diesel_full_text_search::Tsvector;

/// Representation of the `accounts_cryptographic_keys` table.
///
/// (Automatically generated by Diesel.)
accounts_cryptographic_keys (account_id, key_id) {
/// The `account_id` column of the `accounts_cryptographic_keys` table.
///
/// Its SQL type is `Nullable<Uuid>`.
/// Its SQL type is `Uuid`.
///
/// (Automatically generated by Diesel.)
avatar_id -> Nullable<Uuid>,
/// The `header_id` column of the `accounts` table.
account_id -> Uuid,
/// The `key_id` column of the `accounts_cryptographic_keys` table.
///
/// Its SQL type is `Nullable<Uuid>`.
/// Its SQL type is `Text`.
///
/// (Automatically generated by Diesel.)
header_id -> Nullable<Uuid>,
key_id -> Text,
}
}

Expand Down Expand Up @@ -267,6 +301,41 @@ diesel::table! {
}
}

diesel::table! {
use diesel::sql_types::*;
use diesel_full_text_search::Tsvector;

/// Representation of the `cryptographic_keys` table.
///
/// (Automatically generated by Diesel.)
cryptographic_keys (key_id) {
/// The `key_id` column of the `cryptographic_keys` table.
///
/// Its SQL type is `Text`.
///
/// (Automatically generated by Diesel.)
key_id -> Text,
/// The `public_key_pem` column of the `cryptographic_keys` table.
///
/// Its SQL type is `Text`.
///
/// (Automatically generated by Diesel.)
public_key_pem -> Text,
/// The `private_key_pem` column of the `cryptographic_keys` table.
///
/// Its SQL type is `Nullable<Text>`.
///
/// (Automatically generated by Diesel.)
private_key_pem -> Nullable<Text>,
/// The `created_at` column of the `cryptographic_keys` table.
///
/// Its SQL type is `Timestamptz`.
///
/// (Automatically generated by Diesel.)
created_at -> Timestamptz,
}
}

diesel::table! {
use diesel::sql_types::*;
use diesel_full_text_search::Tsvector;
Expand Down Expand Up @@ -765,6 +834,12 @@ diesel::table! {
///
/// (Automatically generated by Diesel.)
content_lang -> LanguageIsoCode,
/// The `link_preview_url` column of the `posts` table.
///
/// Its SQL type is `Nullable<Text>`.
///
/// (Automatically generated by Diesel.)
link_preview_url -> Nullable<Text>,
/// The `visibility` column of the `posts` table.
///
/// Its SQL type is `Int4`.
Expand Down Expand Up @@ -801,12 +876,6 @@ diesel::table! {
///
/// (Automatically generated by Diesel.)
post_ts -> Tsvector,
/// The `link_preview_url` column of the `posts` table.
///
/// Its SQL type is `Nullable<Text>`.
///
/// (Automatically generated by Diesel.)
link_preview_url -> Nullable<Text>,
}
}

Expand Down Expand Up @@ -946,12 +1015,6 @@ diesel::table! {
///
/// (Automatically generated by Diesel.)
id -> Uuid,
/// The `account_id` column of the `users` table.
///
/// Its SQL type is `Uuid`.
///
/// (Automatically generated by Diesel.)
account_id -> Uuid,
/// The `oidc_id` column of the `users` table.
///
/// Its SQL type is `Nullable<Text>`.
Expand Down Expand Up @@ -982,12 +1045,6 @@ diesel::table! {
///
/// (Automatically generated by Diesel.)
domain -> Text,
/// The `private_key` column of the `users` table.
///
/// Its SQL type is `Text`.
///
/// (Automatically generated by Diesel.)
private_key -> Text,
/// The `confirmed_at` column of the `users` table.
///
/// Its SQL type is `Nullable<Timestamptz>`.
Expand Down Expand Up @@ -1015,6 +1072,29 @@ diesel::table! {
}
}

diesel::table! {
use diesel::sql_types::*;
use diesel_full_text_search::Tsvector;

/// Representation of the `users_accounts` table.
///
/// (Automatically generated by Diesel.)
users_accounts (user_id, account_id) {
/// The `user_id` column of the `users_accounts` table.
///
/// Its SQL type is `Uuid`.
///
/// (Automatically generated by Diesel.)
user_id -> Uuid,
/// The `account_id` column of the `users_accounts` table.
///
/// Its SQL type is `Uuid`.
///
/// (Automatically generated by Diesel.)
account_id -> Uuid,
}
}

diesel::table! {
use diesel::sql_types::*;
use diesel_full_text_search::Tsvector;
Expand Down Expand Up @@ -1050,6 +1130,10 @@ diesel::table! {
}
}

diesel::joinable!(accounts_activitypub -> accounts (account_id));
diesel::joinable!(accounts_activitypub -> cryptographic_keys (key_id));
diesel::joinable!(accounts_cryptographic_keys -> accounts (account_id));
diesel::joinable!(accounts_cryptographic_keys -> cryptographic_keys (key_id));
diesel::joinable!(accounts_preferences -> accounts (account_id));
diesel::joinable!(custom_emojis -> media_attachments (media_attachment_id));
diesel::joinable!(notifications -> posts (post_id));
Expand All @@ -1069,13 +1153,17 @@ diesel::joinable!(posts_media_attachments -> media_attachments (media_attachment
diesel::joinable!(posts_media_attachments -> posts (post_id));
diesel::joinable!(posts_mentions -> accounts (account_id));
diesel::joinable!(posts_mentions -> posts (post_id));
diesel::joinable!(users -> accounts (account_id));
diesel::joinable!(users_accounts -> accounts (account_id));
diesel::joinable!(users_accounts -> users (user_id));
diesel::joinable!(users_roles -> users (user_id));

diesel::allow_tables_to_appear_in_same_query!(
accounts,
accounts_activitypub,
accounts_cryptographic_keys,
accounts_follows,
accounts_preferences,
cryptographic_keys,
custom_emojis,
job_context,
link_previews,
Expand All @@ -1091,5 +1179,6 @@ diesel::allow_tables_to_appear_in_same_query!(
posts_media_attachments,
posts_mentions,
users,
users_accounts,
users_roles,
);

0 comments on commit 8bdc05c

Please sign in to comment.