scufflecloud_core/schema.rs
1#![cfg_attr(coverage_nightly, coverage(off))]
2// @generated automatically by Diesel CLI.
3
4/// A module containing custom SQL type definitions
5///
6/// (Automatically generated by Diesel.)
7pub(crate) mod sql_types {
8 /// The `device_algorithm` SQL type
9 ///
10 /// (Automatically generated by Diesel.)
11 #[derive(diesel::query_builder::QueryId, Clone, diesel::sql_types::SqlType)]
12 #[diesel(postgres_type(name = "device_algorithm"))]
13 pub struct DeviceAlgorithm;
14}
15
16diesel::table! {
17 /// Representation of the `email_registration_requests` table.
18 ///
19 /// (Automatically generated by Diesel.)
20 email_registration_requests (id) {
21 /// The `id` column of the `email_registration_requests` table.
22 ///
23 /// Its SQL type is `Uuid`.
24 ///
25 /// (Automatically generated by Diesel.)
26 id -> Uuid,
27 /// The `user_id` column of the `email_registration_requests` table.
28 ///
29 /// Its SQL type is `Nullable<Uuid>`.
30 ///
31 /// (Automatically generated by Diesel.)
32 user_id -> Nullable<Uuid>,
33 /// The `email` column of the `email_registration_requests` table.
34 ///
35 /// Its SQL type is `Varchar`.
36 ///
37 /// (Automatically generated by Diesel.)
38 #[max_length = 255]
39 email -> Varchar,
40 /// The `code` column of the `email_registration_requests` table.
41 ///
42 /// Its SQL type is `Bytea`.
43 ///
44 /// (Automatically generated by Diesel.)
45 code -> Bytea,
46 /// The `expires_at` column of the `email_registration_requests` table.
47 ///
48 /// Its SQL type is `Timestamptz`.
49 ///
50 /// (Automatically generated by Diesel.)
51 expires_at -> Timestamptz,
52 }
53}
54
55diesel::table! {
56 /// Representation of the `magic_link_user_session_requests` table.
57 ///
58 /// (Automatically generated by Diesel.)
59 magic_link_user_session_requests (id) {
60 /// The `id` column of the `magic_link_user_session_requests` table.
61 ///
62 /// Its SQL type is `Uuid`.
63 ///
64 /// (Automatically generated by Diesel.)
65 id -> Uuid,
66 /// The `user_id` column of the `magic_link_user_session_requests` table.
67 ///
68 /// Its SQL type is `Uuid`.
69 ///
70 /// (Automatically generated by Diesel.)
71 user_id -> Uuid,
72 /// The `code` column of the `magic_link_user_session_requests` table.
73 ///
74 /// Its SQL type is `Bytea`.
75 ///
76 /// (Automatically generated by Diesel.)
77 code -> Bytea,
78 /// The `expires_at` column of the `magic_link_user_session_requests` table.
79 ///
80 /// Its SQL type is `Timestamptz`.
81 ///
82 /// (Automatically generated by Diesel.)
83 expires_at -> Timestamptz,
84 }
85}
86
87diesel::table! {
88 /// Representation of the `mfa_recovery_codes` table.
89 ///
90 /// (Automatically generated by Diesel.)
91 mfa_recovery_codes (id) {
92 /// The `id` column of the `mfa_recovery_codes` table.
93 ///
94 /// Its SQL type is `Uuid`.
95 ///
96 /// (Automatically generated by Diesel.)
97 id -> Uuid,
98 /// The `user_id` column of the `mfa_recovery_codes` table.
99 ///
100 /// Its SQL type is `Uuid`.
101 ///
102 /// (Automatically generated by Diesel.)
103 user_id -> Uuid,
104 /// The `code_hash` column of the `mfa_recovery_codes` table.
105 ///
106 /// Its SQL type is `Varchar`.
107 ///
108 /// (Automatically generated by Diesel.)
109 #[max_length = 255]
110 code_hash -> Varchar,
111 }
112}
113
114diesel::table! {
115 /// Representation of the `mfa_totp_credentials` table.
116 ///
117 /// (Automatically generated by Diesel.)
118 mfa_totp_credentials (id) {
119 /// The `id` column of the `mfa_totp_credentials` table.
120 ///
121 /// Its SQL type is `Uuid`.
122 ///
123 /// (Automatically generated by Diesel.)
124 id -> Uuid,
125 /// The `user_id` column of the `mfa_totp_credentials` table.
126 ///
127 /// Its SQL type is `Uuid`.
128 ///
129 /// (Automatically generated by Diesel.)
130 user_id -> Uuid,
131 /// The `name` column of the `mfa_totp_credentials` table.
132 ///
133 /// Its SQL type is `Varchar`.
134 ///
135 /// (Automatically generated by Diesel.)
136 #[max_length = 255]
137 name -> Varchar,
138 /// The `secret` column of the `mfa_totp_credentials` table.
139 ///
140 /// Its SQL type is `Bytea`.
141 ///
142 /// (Automatically generated by Diesel.)
143 secret -> Bytea,
144 /// The `last_used_at` column of the `mfa_totp_credentials` table.
145 ///
146 /// Its SQL type is `Timestamptz`.
147 ///
148 /// (Automatically generated by Diesel.)
149 last_used_at -> Timestamptz,
150 }
151}
152
153diesel::table! {
154 /// Representation of the `mfa_totp_reg_sessions` table.
155 ///
156 /// (Automatically generated by Diesel.)
157 mfa_totp_reg_sessions (user_id) {
158 /// The `user_id` column of the `mfa_totp_reg_sessions` table.
159 ///
160 /// Its SQL type is `Uuid`.
161 ///
162 /// (Automatically generated by Diesel.)
163 user_id -> Uuid,
164 /// The `secret` column of the `mfa_totp_reg_sessions` table.
165 ///
166 /// Its SQL type is `Bytea`.
167 ///
168 /// (Automatically generated by Diesel.)
169 secret -> Bytea,
170 /// The `expires_at` column of the `mfa_totp_reg_sessions` table.
171 ///
172 /// Its SQL type is `Timestamptz`.
173 ///
174 /// (Automatically generated by Diesel.)
175 expires_at -> Timestamptz,
176 }
177}
178
179diesel::table! {
180 /// Representation of the `mfa_webauthn_auth_sessions` table.
181 ///
182 /// (Automatically generated by Diesel.)
183 mfa_webauthn_auth_sessions (user_id) {
184 /// The `user_id` column of the `mfa_webauthn_auth_sessions` table.
185 ///
186 /// Its SQL type is `Uuid`.
187 ///
188 /// (Automatically generated by Diesel.)
189 user_id -> Uuid,
190 /// The `state` column of the `mfa_webauthn_auth_sessions` table.
191 ///
192 /// Its SQL type is `Jsonb`.
193 ///
194 /// (Automatically generated by Diesel.)
195 state -> Jsonb,
196 /// The `expires_at` column of the `mfa_webauthn_auth_sessions` table.
197 ///
198 /// Its SQL type is `Timestamptz`.
199 ///
200 /// (Automatically generated by Diesel.)
201 expires_at -> Timestamptz,
202 }
203}
204
205diesel::table! {
206 /// Representation of the `mfa_webauthn_credentials` table.
207 ///
208 /// (Automatically generated by Diesel.)
209 mfa_webauthn_credentials (id) {
210 /// The `id` column of the `mfa_webauthn_credentials` table.
211 ///
212 /// Its SQL type is `Uuid`.
213 ///
214 /// (Automatically generated by Diesel.)
215 id -> Uuid,
216 /// The `user_id` column of the `mfa_webauthn_credentials` table.
217 ///
218 /// Its SQL type is `Uuid`.
219 ///
220 /// (Automatically generated by Diesel.)
221 user_id -> Uuid,
222 /// The `name` column of the `mfa_webauthn_credentials` table.
223 ///
224 /// Its SQL type is `Varchar`.
225 ///
226 /// (Automatically generated by Diesel.)
227 #[max_length = 255]
228 name -> Varchar,
229 /// The `credential_id` column of the `mfa_webauthn_credentials` table.
230 ///
231 /// Its SQL type is `Bytea`.
232 ///
233 /// (Automatically generated by Diesel.)
234 credential_id -> Bytea,
235 /// The `credential` column of the `mfa_webauthn_credentials` table.
236 ///
237 /// Its SQL type is `Jsonb`.
238 ///
239 /// (Automatically generated by Diesel.)
240 credential -> Jsonb,
241 /// The `counter` column of the `mfa_webauthn_credentials` table.
242 ///
243 /// Its SQL type is `Nullable<Int8>`.
244 ///
245 /// (Automatically generated by Diesel.)
246 counter -> Nullable<Int8>,
247 /// The `last_used_at` column of the `mfa_webauthn_credentials` table.
248 ///
249 /// Its SQL type is `Timestamptz`.
250 ///
251 /// (Automatically generated by Diesel.)
252 last_used_at -> Timestamptz,
253 }
254}
255
256diesel::table! {
257 /// Representation of the `mfa_webauthn_reg_sessions` table.
258 ///
259 /// (Automatically generated by Diesel.)
260 mfa_webauthn_reg_sessions (user_id) {
261 /// The `user_id` column of the `mfa_webauthn_reg_sessions` table.
262 ///
263 /// Its SQL type is `Uuid`.
264 ///
265 /// (Automatically generated by Diesel.)
266 user_id -> Uuid,
267 /// The `state` column of the `mfa_webauthn_reg_sessions` table.
268 ///
269 /// Its SQL type is `Jsonb`.
270 ///
271 /// (Automatically generated by Diesel.)
272 state -> Jsonb,
273 /// The `expires_at` column of the `mfa_webauthn_reg_sessions` table.
274 ///
275 /// Its SQL type is `Timestamptz`.
276 ///
277 /// (Automatically generated by Diesel.)
278 expires_at -> Timestamptz,
279 }
280}
281
282diesel::table! {
283 /// Representation of the `organization_invitations` table.
284 ///
285 /// (Automatically generated by Diesel.)
286 organization_invitations (id) {
287 /// The `id` column of the `organization_invitations` table.
288 ///
289 /// Its SQL type is `Uuid`.
290 ///
291 /// (Automatically generated by Diesel.)
292 id -> Uuid,
293 /// The `user_id` column of the `organization_invitations` table.
294 ///
295 /// Its SQL type is `Nullable<Uuid>`.
296 ///
297 /// (Automatically generated by Diesel.)
298 user_id -> Nullable<Uuid>,
299 /// The `organization_id` column of the `organization_invitations` table.
300 ///
301 /// Its SQL type is `Uuid`.
302 ///
303 /// (Automatically generated by Diesel.)
304 organization_id -> Uuid,
305 /// The `email` column of the `organization_invitations` table.
306 ///
307 /// Its SQL type is `Varchar`.
308 ///
309 /// (Automatically generated by Diesel.)
310 #[max_length = 255]
311 email -> Varchar,
312 /// The `invited_by_id` column of the `organization_invitations` table.
313 ///
314 /// Its SQL type is `Uuid`.
315 ///
316 /// (Automatically generated by Diesel.)
317 invited_by_id -> Uuid,
318 /// The `expires_at` column of the `organization_invitations` table.
319 ///
320 /// Its SQL type is `Nullable<Timestamptz>`.
321 ///
322 /// (Automatically generated by Diesel.)
323 expires_at -> Nullable<Timestamptz>,
324 }
325}
326
327diesel::table! {
328 /// Representation of the `organization_member_policies` table.
329 ///
330 /// (Automatically generated by Diesel.)
331 organization_member_policies (organization_id, user_id, policy_id) {
332 /// The `organization_id` column of the `organization_member_policies` table.
333 ///
334 /// Its SQL type is `Uuid`.
335 ///
336 /// (Automatically generated by Diesel.)
337 organization_id -> Uuid,
338 /// The `user_id` column of the `organization_member_policies` table.
339 ///
340 /// Its SQL type is `Uuid`.
341 ///
342 /// (Automatically generated by Diesel.)
343 user_id -> Uuid,
344 /// The `policy_id` column of the `organization_member_policies` table.
345 ///
346 /// Its SQL type is `Uuid`.
347 ///
348 /// (Automatically generated by Diesel.)
349 policy_id -> Uuid,
350 }
351}
352
353diesel::table! {
354 /// Representation of the `organization_members` table.
355 ///
356 /// (Automatically generated by Diesel.)
357 organization_members (organization_id, user_id) {
358 /// The `organization_id` column of the `organization_members` table.
359 ///
360 /// Its SQL type is `Uuid`.
361 ///
362 /// (Automatically generated by Diesel.)
363 organization_id -> Uuid,
364 /// The `user_id` column of the `organization_members` table.
365 ///
366 /// Its SQL type is `Uuid`.
367 ///
368 /// (Automatically generated by Diesel.)
369 user_id -> Uuid,
370 /// The `invited_by_id` column of the `organization_members` table.
371 ///
372 /// Its SQL type is `Nullable<Uuid>`.
373 ///
374 /// (Automatically generated by Diesel.)
375 invited_by_id -> Nullable<Uuid>,
376 /// The `inline_policy` column of the `organization_members` table.
377 ///
378 /// Its SQL type is `Nullable<Varchar>`.
379 ///
380 /// (Automatically generated by Diesel.)
381 #[max_length = 255]
382 inline_policy -> Nullable<Varchar>,
383 /// The `created_at` column of the `organization_members` table.
384 ///
385 /// Its SQL type is `Timestamptz`.
386 ///
387 /// (Automatically generated by Diesel.)
388 created_at -> Timestamptz,
389 }
390}
391
392diesel::table! {
393 /// Representation of the `organizations` table.
394 ///
395 /// (Automatically generated by Diesel.)
396 organizations (id) {
397 /// The `id` column of the `organizations` table.
398 ///
399 /// Its SQL type is `Uuid`.
400 ///
401 /// (Automatically generated by Diesel.)
402 id -> Uuid,
403 /// The `google_customer_id` column of the `organizations` table.
404 ///
405 /// Its SQL type is `Nullable<Varchar>`.
406 ///
407 /// (Automatically generated by Diesel.)
408 #[max_length = 255]
409 google_customer_id -> Nullable<Varchar>,
410 /// The `google_hosted_domain` column of the `organizations` table.
411 ///
412 /// Its SQL type is `Nullable<Varchar>`.
413 ///
414 /// (Automatically generated by Diesel.)
415 #[max_length = 255]
416 google_hosted_domain -> Nullable<Varchar>,
417 /// The `name` column of the `organizations` table.
418 ///
419 /// Its SQL type is `Varchar`.
420 ///
421 /// (Automatically generated by Diesel.)
422 #[max_length = 255]
423 name -> Varchar,
424 /// The `owner_id` column of the `organizations` table.
425 ///
426 /// Its SQL type is `Uuid`.
427 ///
428 /// (Automatically generated by Diesel.)
429 owner_id -> Uuid,
430 }
431}
432
433diesel::table! {
434 /// Representation of the `policies` table.
435 ///
436 /// (Automatically generated by Diesel.)
437 policies (id) {
438 /// The `id` column of the `policies` table.
439 ///
440 /// Its SQL type is `Uuid`.
441 ///
442 /// (Automatically generated by Diesel.)
443 id -> Uuid,
444 /// The `organization_id` column of the `policies` table.
445 ///
446 /// Its SQL type is `Uuid`.
447 ///
448 /// (Automatically generated by Diesel.)
449 organization_id -> Uuid,
450 /// The `project_id` column of the `policies` table.
451 ///
452 /// Its SQL type is `Nullable<Uuid>`.
453 ///
454 /// (Automatically generated by Diesel.)
455 project_id -> Nullable<Uuid>,
456 /// The `name` column of the `policies` table.
457 ///
458 /// Its SQL type is `Varchar`.
459 ///
460 /// (Automatically generated by Diesel.)
461 #[max_length = 255]
462 name -> Varchar,
463 /// The `description` column of the `policies` table.
464 ///
465 /// Its SQL type is `Nullable<Text>`.
466 ///
467 /// (Automatically generated by Diesel.)
468 description -> Nullable<Text>,
469 /// The `policy` column of the `policies` table.
470 ///
471 /// Its SQL type is `Varchar`.
472 ///
473 /// (Automatically generated by Diesel.)
474 #[max_length = 255]
475 policy -> Varchar,
476 }
477}
478
479diesel::table! {
480 /// Representation of the `projects` table.
481 ///
482 /// (Automatically generated by Diesel.)
483 projects (id) {
484 /// The `id` column of the `projects` table.
485 ///
486 /// Its SQL type is `Uuid`.
487 ///
488 /// (Automatically generated by Diesel.)
489 id -> Uuid,
490 /// The `name` column of the `projects` table.
491 ///
492 /// Its SQL type is `Varchar`.
493 ///
494 /// (Automatically generated by Diesel.)
495 #[max_length = 255]
496 name -> Varchar,
497 /// The `organization_id` column of the `projects` table.
498 ///
499 /// Its SQL type is `Uuid`.
500 ///
501 /// (Automatically generated by Diesel.)
502 organization_id -> Uuid,
503 }
504}
505
506diesel::table! {
507 /// Representation of the `role_policies` table.
508 ///
509 /// (Automatically generated by Diesel.)
510 role_policies (role_id, policy_id) {
511 /// The `role_id` column of the `role_policies` table.
512 ///
513 /// Its SQL type is `Uuid`.
514 ///
515 /// (Automatically generated by Diesel.)
516 role_id -> Uuid,
517 /// The `policy_id` column of the `role_policies` table.
518 ///
519 /// Its SQL type is `Uuid`.
520 ///
521 /// (Automatically generated by Diesel.)
522 policy_id -> Uuid,
523 }
524}
525
526diesel::table! {
527 /// Representation of the `roles` table.
528 ///
529 /// (Automatically generated by Diesel.)
530 roles (id) {
531 /// The `id` column of the `roles` table.
532 ///
533 /// Its SQL type is `Uuid`.
534 ///
535 /// (Automatically generated by Diesel.)
536 id -> Uuid,
537 /// The `organization_id` column of the `roles` table.
538 ///
539 /// Its SQL type is `Uuid`.
540 ///
541 /// (Automatically generated by Diesel.)
542 organization_id -> Uuid,
543 /// The `name` column of the `roles` table.
544 ///
545 /// Its SQL type is `Varchar`.
546 ///
547 /// (Automatically generated by Diesel.)
548 #[max_length = 255]
549 name -> Varchar,
550 /// The `description` column of the `roles` table.
551 ///
552 /// Its SQL type is `Nullable<Text>`.
553 ///
554 /// (Automatically generated by Diesel.)
555 description -> Nullable<Text>,
556 /// The `inline_policy` column of the `roles` table.
557 ///
558 /// Its SQL type is `Nullable<Varchar>`.
559 ///
560 /// (Automatically generated by Diesel.)
561 #[max_length = 255]
562 inline_policy -> Nullable<Varchar>,
563 }
564}
565
566diesel::table! {
567 /// Representation of the `service_account_policies` table.
568 ///
569 /// (Automatically generated by Diesel.)
570 service_account_policies (service_account_id, policy_id) {
571 /// The `service_account_id` column of the `service_account_policies` table.
572 ///
573 /// Its SQL type is `Uuid`.
574 ///
575 /// (Automatically generated by Diesel.)
576 service_account_id -> Uuid,
577 /// The `policy_id` column of the `service_account_policies` table.
578 ///
579 /// Its SQL type is `Uuid`.
580 ///
581 /// (Automatically generated by Diesel.)
582 policy_id -> Uuid,
583 }
584}
585
586diesel::table! {
587 /// Representation of the `service_account_tokens` table.
588 ///
589 /// (Automatically generated by Diesel.)
590 service_account_tokens (id) {
591 /// The `id` column of the `service_account_tokens` table.
592 ///
593 /// Its SQL type is `Uuid`.
594 ///
595 /// (Automatically generated by Diesel.)
596 id -> Uuid,
597 /// The `active` column of the `service_account_tokens` table.
598 ///
599 /// Its SQL type is `Bool`.
600 ///
601 /// (Automatically generated by Diesel.)
602 active -> Bool,
603 /// The `service_account_id` column of the `service_account_tokens` table.
604 ///
605 /// Its SQL type is `Uuid`.
606 ///
607 /// (Automatically generated by Diesel.)
608 service_account_id -> Uuid,
609 /// The `token` column of the `service_account_tokens` table.
610 ///
611 /// Its SQL type is `Bytea`.
612 ///
613 /// (Automatically generated by Diesel.)
614 token -> Bytea,
615 /// The `inline_policy` column of the `service_account_tokens` table.
616 ///
617 /// Its SQL type is `Nullable<Varchar>`.
618 ///
619 /// (Automatically generated by Diesel.)
620 #[max_length = 255]
621 inline_policy -> Nullable<Varchar>,
622 /// The `expires_at` column of the `service_account_tokens` table.
623 ///
624 /// Its SQL type is `Nullable<Timestamptz>`.
625 ///
626 /// (Automatically generated by Diesel.)
627 expires_at -> Nullable<Timestamptz>,
628 }
629}
630
631diesel::table! {
632 /// Representation of the `service_accounts` table.
633 ///
634 /// (Automatically generated by Diesel.)
635 service_accounts (id) {
636 /// The `id` column of the `service_accounts` table.
637 ///
638 /// Its SQL type is `Uuid`.
639 ///
640 /// (Automatically generated by Diesel.)
641 id -> Uuid,
642 /// The `name` column of the `service_accounts` table.
643 ///
644 /// Its SQL type is `Varchar`.
645 ///
646 /// (Automatically generated by Diesel.)
647 #[max_length = 255]
648 name -> Varchar,
649 /// The `organization_id` column of the `service_accounts` table.
650 ///
651 /// Its SQL type is `Uuid`.
652 ///
653 /// (Automatically generated by Diesel.)
654 organization_id -> Uuid,
655 /// The `project_id` column of the `service_accounts` table.
656 ///
657 /// Its SQL type is `Nullable<Uuid>`.
658 ///
659 /// (Automatically generated by Diesel.)
660 project_id -> Nullable<Uuid>,
661 /// The `inline_policy` column of the `service_accounts` table.
662 ///
663 /// Its SQL type is `Nullable<Varchar>`.
664 ///
665 /// (Automatically generated by Diesel.)
666 #[max_length = 255]
667 inline_policy -> Nullable<Varchar>,
668 }
669}
670
671diesel::table! {
672 /// Representation of the `user_emails` table.
673 ///
674 /// (Automatically generated by Diesel.)
675 user_emails (email) {
676 /// The `email` column of the `user_emails` table.
677 ///
678 /// Its SQL type is `Varchar`.
679 ///
680 /// (Automatically generated by Diesel.)
681 #[max_length = 255]
682 email -> Varchar,
683 /// The `user_id` column of the `user_emails` table.
684 ///
685 /// Its SQL type is `Uuid`.
686 ///
687 /// (Automatically generated by Diesel.)
688 user_id -> Uuid,
689 /// The `created_at` column of the `user_emails` table.
690 ///
691 /// Its SQL type is `Timestamptz`.
692 ///
693 /// (Automatically generated by Diesel.)
694 created_at -> Timestamptz,
695 }
696}
697
698diesel::table! {
699 /// Representation of the `user_google_accounts` table.
700 ///
701 /// (Automatically generated by Diesel.)
702 user_google_accounts (sub) {
703 /// The `sub` column of the `user_google_accounts` table.
704 ///
705 /// Its SQL type is `Varchar`.
706 ///
707 /// (Automatically generated by Diesel.)
708 #[max_length = 255]
709 sub -> Varchar,
710 /// The `user_id` column of the `user_google_accounts` table.
711 ///
712 /// Its SQL type is `Uuid`.
713 ///
714 /// (Automatically generated by Diesel.)
715 user_id -> Uuid,
716 /// The `access_token` column of the `user_google_accounts` table.
717 ///
718 /// Its SQL type is `Varchar`.
719 ///
720 /// (Automatically generated by Diesel.)
721 #[max_length = 255]
722 access_token -> Varchar,
723 /// The `access_token_expires_at` column of the `user_google_accounts` table.
724 ///
725 /// Its SQL type is `Timestamptz`.
726 ///
727 /// (Automatically generated by Diesel.)
728 access_token_expires_at -> Timestamptz,
729 /// The `created_at` column of the `user_google_accounts` table.
730 ///
731 /// Its SQL type is `Timestamptz`.
732 ///
733 /// (Automatically generated by Diesel.)
734 created_at -> Timestamptz,
735 }
736}
737
738diesel::table! {
739 /// Representation of the `user_session_requests` table.
740 ///
741 /// (Automatically generated by Diesel.)
742 user_session_requests (id) {
743 /// The `id` column of the `user_session_requests` table.
744 ///
745 /// Its SQL type is `Uuid`.
746 ///
747 /// (Automatically generated by Diesel.)
748 id -> Uuid,
749 /// The `device_name` column of the `user_session_requests` table.
750 ///
751 /// Its SQL type is `Varchar`.
752 ///
753 /// (Automatically generated by Diesel.)
754 #[max_length = 255]
755 device_name -> Varchar,
756 /// The `device_ip` column of the `user_session_requests` table.
757 ///
758 /// Its SQL type is `Inet`.
759 ///
760 /// (Automatically generated by Diesel.)
761 device_ip -> Inet,
762 /// The `code` column of the `user_session_requests` table.
763 ///
764 /// Its SQL type is `Varchar`.
765 ///
766 /// (Automatically generated by Diesel.)
767 #[max_length = 6]
768 code -> Varchar,
769 /// The `approved_by` column of the `user_session_requests` table.
770 ///
771 /// Its SQL type is `Nullable<Uuid>`.
772 ///
773 /// (Automatically generated by Diesel.)
774 approved_by -> Nullable<Uuid>,
775 /// The `expires_at` column of the `user_session_requests` table.
776 ///
777 /// Its SQL type is `Timestamptz`.
778 ///
779 /// (Automatically generated by Diesel.)
780 expires_at -> Timestamptz,
781 }
782}
783
784diesel::table! {
785 use diesel::sql_types::*;
786 use super::sql_types::DeviceAlgorithm;
787
788 /// Representation of the `user_sessions` table.
789 ///
790 /// (Automatically generated by Diesel.)
791 user_sessions (user_id, device_fingerprint) {
792 /// The `user_id` column of the `user_sessions` table.
793 ///
794 /// Its SQL type is `Uuid`.
795 ///
796 /// (Automatically generated by Diesel.)
797 user_id -> Uuid,
798 /// The `device_fingerprint` column of the `user_sessions` table.
799 ///
800 /// Its SQL type is `Bytea`.
801 ///
802 /// (Automatically generated by Diesel.)
803 device_fingerprint -> Bytea,
804 /// The `device_algorithm` column of the `user_sessions` table.
805 ///
806 /// Its SQL type is `DeviceAlgorithm`.
807 ///
808 /// (Automatically generated by Diesel.)
809 device_algorithm -> DeviceAlgorithm,
810 /// The `device_pk_data` column of the `user_sessions` table.
811 ///
812 /// Its SQL type is `Bytea`.
813 ///
814 /// (Automatically generated by Diesel.)
815 device_pk_data -> Bytea,
816 /// The `last_used_at` column of the `user_sessions` table.
817 ///
818 /// Its SQL type is `Timestamptz`.
819 ///
820 /// (Automatically generated by Diesel.)
821 last_used_at -> Timestamptz,
822 /// The `last_ip` column of the `user_sessions` table.
823 ///
824 /// Its SQL type is `Inet`.
825 ///
826 /// (Automatically generated by Diesel.)
827 last_ip -> Inet,
828 /// The `token_id` column of the `user_sessions` table.
829 ///
830 /// Its SQL type is `Nullable<Uuid>`.
831 ///
832 /// (Automatically generated by Diesel.)
833 token_id -> Nullable<Uuid>,
834 /// The `token` column of the `user_sessions` table.
835 ///
836 /// Its SQL type is `Nullable<Bytea>`.
837 ///
838 /// (Automatically generated by Diesel.)
839 token -> Nullable<Bytea>,
840 /// The `token_expires_at` column of the `user_sessions` table.
841 ///
842 /// Its SQL type is `Nullable<Timestamptz>`.
843 ///
844 /// (Automatically generated by Diesel.)
845 token_expires_at -> Nullable<Timestamptz>,
846 /// The `expires_at` column of the `user_sessions` table.
847 ///
848 /// Its SQL type is `Timestamptz`.
849 ///
850 /// (Automatically generated by Diesel.)
851 expires_at -> Timestamptz,
852 /// The `mfa_pending` column of the `user_sessions` table.
853 ///
854 /// Its SQL type is `Bool`.
855 ///
856 /// (Automatically generated by Diesel.)
857 mfa_pending -> Bool,
858 }
859}
860
861diesel::table! {
862 /// Representation of the `users` table.
863 ///
864 /// (Automatically generated by Diesel.)
865 users (id) {
866 /// The `id` column of the `users` table.
867 ///
868 /// Its SQL type is `Uuid`.
869 ///
870 /// (Automatically generated by Diesel.)
871 id -> Uuid,
872 /// The `preferred_name` column of the `users` table.
873 ///
874 /// Its SQL type is `Nullable<Varchar>`.
875 ///
876 /// (Automatically generated by Diesel.)
877 #[max_length = 255]
878 preferred_name -> Nullable<Varchar>,
879 /// The `first_name` column of the `users` table.
880 ///
881 /// Its SQL type is `Nullable<Varchar>`.
882 ///
883 /// (Automatically generated by Diesel.)
884 #[max_length = 255]
885 first_name -> Nullable<Varchar>,
886 /// The `last_name` column of the `users` table.
887 ///
888 /// Its SQL type is `Nullable<Varchar>`.
889 ///
890 /// (Automatically generated by Diesel.)
891 #[max_length = 255]
892 last_name -> Nullable<Varchar>,
893 /// The `password_hash` column of the `users` table.
894 ///
895 /// Its SQL type is `Nullable<Varchar>`.
896 ///
897 /// (Automatically generated by Diesel.)
898 #[max_length = 255]
899 password_hash -> Nullable<Varchar>,
900 /// The `primary_email` column of the `users` table.
901 ///
902 /// Its SQL type is `Nullable<Varchar>`.
903 ///
904 /// (Automatically generated by Diesel.)
905 #[max_length = 255]
906 primary_email -> Nullable<Varchar>,
907 }
908}
909
910diesel::joinable!(email_registration_requests -> users (user_id));
911diesel::joinable!(magic_link_user_session_requests -> users (user_id));
912diesel::joinable!(mfa_recovery_codes -> users (user_id));
913diesel::joinable!(mfa_totp_credentials -> users (user_id));
914diesel::joinable!(mfa_totp_reg_sessions -> users (user_id));
915diesel::joinable!(mfa_webauthn_auth_sessions -> users (user_id));
916diesel::joinable!(mfa_webauthn_credentials -> users (user_id));
917diesel::joinable!(mfa_webauthn_reg_sessions -> users (user_id));
918diesel::joinable!(organization_invitations -> organizations (organization_id));
919diesel::joinable!(organization_member_policies -> policies (policy_id));
920diesel::joinable!(organization_members -> organizations (organization_id));
921diesel::joinable!(organizations -> users (owner_id));
922diesel::joinable!(policies -> organizations (organization_id));
923diesel::joinable!(policies -> projects (project_id));
924diesel::joinable!(projects -> organizations (organization_id));
925diesel::joinable!(role_policies -> policies (policy_id));
926diesel::joinable!(role_policies -> roles (role_id));
927diesel::joinable!(roles -> organizations (organization_id));
928diesel::joinable!(service_account_policies -> policies (policy_id));
929diesel::joinable!(service_account_policies -> service_accounts (service_account_id));
930diesel::joinable!(service_account_tokens -> service_accounts (service_account_id));
931diesel::joinable!(service_accounts -> organizations (organization_id));
932diesel::joinable!(service_accounts -> projects (project_id));
933diesel::joinable!(user_google_accounts -> users (user_id));
934diesel::joinable!(user_session_requests -> users (approved_by));
935diesel::joinable!(user_sessions -> users (user_id));
936
937diesel::allow_tables_to_appear_in_same_query!(
938 email_registration_requests,
939 magic_link_user_session_requests,
940 mfa_recovery_codes,
941 mfa_totp_credentials,
942 mfa_totp_reg_sessions,
943 mfa_webauthn_auth_sessions,
944 mfa_webauthn_credentials,
945 mfa_webauthn_reg_sessions,
946 organization_invitations,
947 organization_member_policies,
948 organization_members,
949 organizations,
950 policies,
951 projects,
952 role_policies,
953 roles,
954 service_account_policies,
955 service_account_tokens,
956 service_accounts,
957 user_emails,
958 user_google_accounts,
959 user_session_requests,
960 user_sessions,
961 users,
962);