Skip to content

Commit 8bdc05c

Browse files
committed
update schema
1 parent ed9355c commit 8bdc05c

File tree

1 file changed

+147
-58
lines changed

1 file changed

+147
-58
lines changed

crates/kitsune-db/src/schema.rs

+147-58
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,18 @@ diesel::table! {
2626
///
2727
/// (Automatically generated by Diesel.)
2828
id -> Uuid,
29+
/// The `avatar_id` column of the `accounts` table.
30+
///
31+
/// Its SQL type is `Nullable<Uuid>`.
32+
///
33+
/// (Automatically generated by Diesel.)
34+
avatar_id -> Nullable<Uuid>,
35+
/// The `header_id` column of the `accounts` table.
36+
///
37+
/// Its SQL type is `Nullable<Uuid>`.
38+
///
39+
/// (Automatically generated by Diesel.)
40+
header_id -> Nullable<Uuid>,
2941
/// The `display_name` column of the `accounts` table.
3042
///
3143
/// Its SQL type is `Nullable<Text>`.
@@ -62,96 +74,118 @@ diesel::table! {
6274
///
6375
/// (Automatically generated by Diesel.)
6476
domain -> Text,
65-
/// The `actor_type` column of the `accounts` table.
77+
/// The `account_type` column of the `accounts` table.
6678
///
6779
/// Its SQL type is `Int4`.
6880
///
6981
/// (Automatically generated by Diesel.)
70-
actor_type -> Int4,
82+
account_type -> Int4,
7183
/// The `url` column of the `accounts` table.
7284
///
7385
/// Its SQL type is `Text`.
7486
///
7587
/// (Automatically generated by Diesel.)
7688
url -> Text,
77-
/// The `featured_collection_url` column of the `accounts` table.
89+
/// The `created_at` column of the `accounts` table.
7890
///
79-
/// Its SQL type is `Nullable<Text>`.
91+
/// Its SQL type is `Timestamptz`.
8092
///
8193
/// (Automatically generated by Diesel.)
82-
featured_collection_url -> Nullable<Text>,
83-
/// The `followers_url` column of the `accounts` table.
94+
created_at -> Timestamptz,
95+
/// The `updated_at` column of the `accounts` table.
8496
///
85-
/// Its SQL type is `Nullable<Text>`.
97+
/// Its SQL type is `Timestamptz`.
8698
///
8799
/// (Automatically generated by Diesel.)
88-
followers_url -> Nullable<Text>,
89-
/// The `following_url` column of the `accounts` table.
100+
updated_at -> Timestamptz,
101+
/// The `account_ts` column of the `accounts` table.
90102
///
91-
/// Its SQL type is `Nullable<Text>`.
103+
/// Its SQL type is `Tsvector`.
92104
///
93105
/// (Automatically generated by Diesel.)
94-
following_url -> Nullable<Text>,
95-
/// The `inbox_url` column of the `accounts` table.
106+
account_ts -> Tsvector,
107+
}
108+
}
109+
110+
diesel::table! {
111+
use diesel::sql_types::*;
112+
use diesel_full_text_search::Tsvector;
113+
114+
/// Representation of the `accounts_activitypub` table.
115+
///
116+
/// (Automatically generated by Diesel.)
117+
accounts_activitypub (account_id) {
118+
/// The `account_id` column of the `accounts_activitypub` table.
96119
///
97-
/// Its SQL type is `Nullable<Text>`.
120+
/// Its SQL type is `Uuid`.
98121
///
99122
/// (Automatically generated by Diesel.)
100-
inbox_url -> Nullable<Text>,
101-
/// The `outbox_url` column of the `accounts` table.
123+
account_id -> Uuid,
124+
/// The `featured_collection_url` column of the `accounts_activitypub` table.
102125
///
103126
/// Its SQL type is `Nullable<Text>`.
104127
///
105128
/// (Automatically generated by Diesel.)
106-
outbox_url -> Nullable<Text>,
107-
/// The `shared_inbox_url` column of the `accounts` table.
129+
featured_collection_url -> Nullable<Text>,
130+
/// The `followers_url` column of the `accounts_activitypub` table.
108131
///
109132
/// Its SQL type is `Nullable<Text>`.
110133
///
111134
/// (Automatically generated by Diesel.)
112-
shared_inbox_url -> Nullable<Text>,
113-
/// The `public_key_id` column of the `accounts` table.
135+
followers_url -> Nullable<Text>,
136+
/// The `following_url` column of the `accounts_activitypub` table.
114137
///
115-
/// Its SQL type is `Text`.
138+
/// Its SQL type is `Nullable<Text>`.
116139
///
117140
/// (Automatically generated by Diesel.)
118-
public_key_id -> Text,
119-
/// The `public_key` column of the `accounts` table.
141+
following_url -> Nullable<Text>,
142+
/// The `inbox_url` column of the `accounts_activitypub` table.
120143
///
121-
/// Its SQL type is `Text`.
144+
/// Its SQL type is `Nullable<Text>`.
122145
///
123146
/// (Automatically generated by Diesel.)
124-
public_key -> Text,
125-
/// The `created_at` column of the `accounts` table.
147+
inbox_url -> Nullable<Text>,
148+
/// The `outbox_url` column of the `accounts_activitypub` table.
126149
///
127-
/// Its SQL type is `Timestamptz`.
150+
/// Its SQL type is `Nullable<Text>`.
128151
///
129152
/// (Automatically generated by Diesel.)
130-
created_at -> Timestamptz,
131-
/// The `updated_at` column of the `accounts` table.
153+
outbox_url -> Nullable<Text>,
154+
/// The `shared_inbox_url` column of the `accounts_activitypub` table.
132155
///
133-
/// Its SQL type is `Timestamptz`.
156+
/// Its SQL type is `Nullable<Text>`.
134157
///
135158
/// (Automatically generated by Diesel.)
136-
updated_at -> Timestamptz,
137-
/// The `account_ts` column of the `accounts` table.
159+
shared_inbox_url -> Nullable<Text>,
160+
/// The `key_id` column of the `accounts_activitypub` table.
138161
///
139-
/// Its SQL type is `Tsvector`.
162+
/// Its SQL type is `Text`.
140163
///
141164
/// (Automatically generated by Diesel.)
142-
account_ts -> Tsvector,
143-
/// The `avatar_id` column of the `accounts` table.
165+
key_id -> Text,
166+
}
167+
}
168+
169+
diesel::table! {
170+
use diesel::sql_types::*;
171+
use diesel_full_text_search::Tsvector;
172+
173+
/// Representation of the `accounts_cryptographic_keys` table.
174+
///
175+
/// (Automatically generated by Diesel.)
176+
accounts_cryptographic_keys (account_id, key_id) {
177+
/// The `account_id` column of the `accounts_cryptographic_keys` table.
144178
///
145-
/// Its SQL type is `Nullable<Uuid>`.
179+
/// Its SQL type is `Uuid`.
146180
///
147181
/// (Automatically generated by Diesel.)
148-
avatar_id -> Nullable<Uuid>,
149-
/// The `header_id` column of the `accounts` table.
182+
account_id -> Uuid,
183+
/// The `key_id` column of the `accounts_cryptographic_keys` table.
150184
///
151-
/// Its SQL type is `Nullable<Uuid>`.
185+
/// Its SQL type is `Text`.
152186
///
153187
/// (Automatically generated by Diesel.)
154-
header_id -> Nullable<Uuid>,
188+
key_id -> Text,
155189
}
156190
}
157191

@@ -267,6 +301,41 @@ diesel::table! {
267301
}
268302
}
269303

304+
diesel::table! {
305+
use diesel::sql_types::*;
306+
use diesel_full_text_search::Tsvector;
307+
308+
/// Representation of the `cryptographic_keys` table.
309+
///
310+
/// (Automatically generated by Diesel.)
311+
cryptographic_keys (key_id) {
312+
/// The `key_id` column of the `cryptographic_keys` table.
313+
///
314+
/// Its SQL type is `Text`.
315+
///
316+
/// (Automatically generated by Diesel.)
317+
key_id -> Text,
318+
/// The `public_key_pem` column of the `cryptographic_keys` table.
319+
///
320+
/// Its SQL type is `Text`.
321+
///
322+
/// (Automatically generated by Diesel.)
323+
public_key_pem -> Text,
324+
/// The `private_key_pem` column of the `cryptographic_keys` table.
325+
///
326+
/// Its SQL type is `Nullable<Text>`.
327+
///
328+
/// (Automatically generated by Diesel.)
329+
private_key_pem -> Nullable<Text>,
330+
/// The `created_at` column of the `cryptographic_keys` table.
331+
///
332+
/// Its SQL type is `Timestamptz`.
333+
///
334+
/// (Automatically generated by Diesel.)
335+
created_at -> Timestamptz,
336+
}
337+
}
338+
270339
diesel::table! {
271340
use diesel::sql_types::*;
272341
use diesel_full_text_search::Tsvector;
@@ -765,6 +834,12 @@ diesel::table! {
765834
///
766835
/// (Automatically generated by Diesel.)
767836
content_lang -> LanguageIsoCode,
837+
/// The `link_preview_url` column of the `posts` table.
838+
///
839+
/// Its SQL type is `Nullable<Text>`.
840+
///
841+
/// (Automatically generated by Diesel.)
842+
link_preview_url -> Nullable<Text>,
768843
/// The `visibility` column of the `posts` table.
769844
///
770845
/// Its SQL type is `Int4`.
@@ -801,12 +876,6 @@ diesel::table! {
801876
///
802877
/// (Automatically generated by Diesel.)
803878
post_ts -> Tsvector,
804-
/// The `link_preview_url` column of the `posts` table.
805-
///
806-
/// Its SQL type is `Nullable<Text>`.
807-
///
808-
/// (Automatically generated by Diesel.)
809-
link_preview_url -> Nullable<Text>,
810879
}
811880
}
812881

@@ -946,12 +1015,6 @@ diesel::table! {
9461015
///
9471016
/// (Automatically generated by Diesel.)
9481017
id -> Uuid,
949-
/// The `account_id` column of the `users` table.
950-
///
951-
/// Its SQL type is `Uuid`.
952-
///
953-
/// (Automatically generated by Diesel.)
954-
account_id -> Uuid,
9551018
/// The `oidc_id` column of the `users` table.
9561019
///
9571020
/// Its SQL type is `Nullable<Text>`.
@@ -982,12 +1045,6 @@ diesel::table! {
9821045
///
9831046
/// (Automatically generated by Diesel.)
9841047
domain -> Text,
985-
/// The `private_key` column of the `users` table.
986-
///
987-
/// Its SQL type is `Text`.
988-
///
989-
/// (Automatically generated by Diesel.)
990-
private_key -> Text,
9911048
/// The `confirmed_at` column of the `users` table.
9921049
///
9931050
/// Its SQL type is `Nullable<Timestamptz>`.
@@ -1015,6 +1072,29 @@ diesel::table! {
10151072
}
10161073
}
10171074

1075+
diesel::table! {
1076+
use diesel::sql_types::*;
1077+
use diesel_full_text_search::Tsvector;
1078+
1079+
/// Representation of the `users_accounts` table.
1080+
///
1081+
/// (Automatically generated by Diesel.)
1082+
users_accounts (user_id, account_id) {
1083+
/// The `user_id` column of the `users_accounts` table.
1084+
///
1085+
/// Its SQL type is `Uuid`.
1086+
///
1087+
/// (Automatically generated by Diesel.)
1088+
user_id -> Uuid,
1089+
/// The `account_id` column of the `users_accounts` table.
1090+
///
1091+
/// Its SQL type is `Uuid`.
1092+
///
1093+
/// (Automatically generated by Diesel.)
1094+
account_id -> Uuid,
1095+
}
1096+
}
1097+
10181098
diesel::table! {
10191099
use diesel::sql_types::*;
10201100
use diesel_full_text_search::Tsvector;
@@ -1050,6 +1130,10 @@ diesel::table! {
10501130
}
10511131
}
10521132

1133+
diesel::joinable!(accounts_activitypub -> accounts (account_id));
1134+
diesel::joinable!(accounts_activitypub -> cryptographic_keys (key_id));
1135+
diesel::joinable!(accounts_cryptographic_keys -> accounts (account_id));
1136+
diesel::joinable!(accounts_cryptographic_keys -> cryptographic_keys (key_id));
10531137
diesel::joinable!(accounts_preferences -> accounts (account_id));
10541138
diesel::joinable!(custom_emojis -> media_attachments (media_attachment_id));
10551139
diesel::joinable!(notifications -> posts (post_id));
@@ -1069,13 +1153,17 @@ diesel::joinable!(posts_media_attachments -> media_attachments (media_attachment
10691153
diesel::joinable!(posts_media_attachments -> posts (post_id));
10701154
diesel::joinable!(posts_mentions -> accounts (account_id));
10711155
diesel::joinable!(posts_mentions -> posts (post_id));
1072-
diesel::joinable!(users -> accounts (account_id));
1156+
diesel::joinable!(users_accounts -> accounts (account_id));
1157+
diesel::joinable!(users_accounts -> users (user_id));
10731158
diesel::joinable!(users_roles -> users (user_id));
10741159

10751160
diesel::allow_tables_to_appear_in_same_query!(
10761161
accounts,
1162+
accounts_activitypub,
1163+
accounts_cryptographic_keys,
10771164
accounts_follows,
10781165
accounts_preferences,
1166+
cryptographic_keys,
10791167
custom_emojis,
10801168
job_context,
10811169
link_previews,
@@ -1091,5 +1179,6 @@ diesel::allow_tables_to_appear_in_same_query!(
10911179
posts_media_attachments,
10921180
posts_mentions,
10931181
users,
1182+
users_accounts,
10941183
users_roles,
10951184
);

0 commit comments

Comments
 (0)