2025-02-26 13:10:50 -08:00
|
|
|
// @generated automatically by Diesel CLI.
|
|
|
|
|
|
|
|
diesel::table! {
|
|
|
|
api_keys (id) {
|
|
|
|
id -> Uuid,
|
|
|
|
team_id -> Uuid,
|
2025-02-26 13:10:47 -08:00
|
|
|
created_at -> Timestamptz,
|
|
|
|
last_used_at -> Nullable<Timestamptz>,
|
2025-02-26 13:10:50 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
diesel::table! {
|
|
|
|
browser_sessions (id) {
|
|
|
|
id -> Text,
|
|
|
|
serialized -> Text,
|
2025-02-26 13:10:48 -08:00
|
|
|
created_at -> Timestamptz,
|
2025-02-26 13:10:45 -08:00
|
|
|
expiry -> Nullable<Timestamptz>,
|
2025-02-26 13:10:50 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2025-02-26 13:10:45 -08:00
|
|
|
diesel::table! {
|
|
|
|
channel_selections (project_id, channel_id) {
|
|
|
|
project_id -> Uuid,
|
|
|
|
channel_id -> Uuid,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
diesel::table! {
|
|
|
|
channels (id) {
|
|
|
|
id -> Uuid,
|
|
|
|
team_id -> Uuid,
|
|
|
|
name -> Text,
|
|
|
|
enable_by_default -> Bool,
|
2025-02-26 13:10:27 -08:00
|
|
|
backend_config -> Jsonb,
|
2025-02-26 13:10:45 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2025-02-26 13:10:50 -08:00
|
|
|
diesel::table! {
|
|
|
|
csrf_tokens (id) {
|
|
|
|
id -> Uuid,
|
|
|
|
user_id -> Nullable<Uuid>,
|
2025-02-26 13:10:48 -08:00
|
|
|
created_at -> Timestamptz,
|
2025-02-26 13:10:50 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2025-03-10 14:52:02 -07:00
|
|
|
diesel::table! {
|
|
|
|
governor_entries (id) {
|
|
|
|
id -> Uuid,
|
|
|
|
governor_id -> Uuid,
|
|
|
|
timestamp -> Timestamptz,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
diesel::table! {
|
|
|
|
governors (id) {
|
|
|
|
id -> Uuid,
|
|
|
|
team_id -> Uuid,
|
|
|
|
project_id -> Nullable<Uuid>,
|
|
|
|
window_size -> Interval,
|
|
|
|
max_count -> Int4,
|
|
|
|
rolling_count -> Int4,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2025-02-26 13:10:47 -08:00
|
|
|
diesel::table! {
|
|
|
|
messages (id) {
|
|
|
|
id -> Uuid,
|
2025-02-26 13:10:27 -08:00
|
|
|
channel_id -> Uuid,
|
2025-03-08 22:18:24 -08:00
|
|
|
project_id -> Uuid,
|
2025-02-26 13:10:47 -08:00
|
|
|
created_at -> Timestamptz,
|
2025-02-26 13:10:27 -08:00
|
|
|
sent_at -> Nullable<Timestamptz>,
|
2025-02-26 13:10:47 -08:00
|
|
|
message -> Text,
|
2025-04-21 19:02:23 -07:00
|
|
|
failed_at -> Nullable<Timestamptz>,
|
2025-02-26 13:10:47 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2025-02-26 13:10:50 -08:00
|
|
|
diesel::table! {
|
|
|
|
projects (id) {
|
|
|
|
id -> Uuid,
|
|
|
|
team_id -> Uuid,
|
|
|
|
name -> Text,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2025-04-12 23:05:39 -07:00
|
|
|
diesel::table! {
|
|
|
|
team_invitations (id) {
|
|
|
|
id -> Uuid,
|
|
|
|
team_id -> Uuid,
|
|
|
|
email -> Text,
|
|
|
|
created_by -> Uuid,
|
|
|
|
verification_code -> Text,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2025-02-26 13:10:50 -08:00
|
|
|
diesel::table! {
|
|
|
|
team_memberships (team_id, user_id) {
|
|
|
|
team_id -> Uuid,
|
|
|
|
user_id -> Uuid,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
diesel::table! {
|
|
|
|
teams (id) {
|
|
|
|
id -> Uuid,
|
|
|
|
name -> Text,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
diesel::table! {
|
|
|
|
users (id) {
|
|
|
|
id -> Uuid,
|
|
|
|
uid -> Text,
|
|
|
|
email -> Text,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
diesel::joinable!(api_keys -> teams (team_id));
|
2025-02-26 13:10:45 -08:00
|
|
|
diesel::joinable!(channel_selections -> channels (channel_id));
|
|
|
|
diesel::joinable!(channel_selections -> projects (project_id));
|
|
|
|
diesel::joinable!(channels -> teams (team_id));
|
2025-02-26 13:10:50 -08:00
|
|
|
diesel::joinable!(csrf_tokens -> users (user_id));
|
2025-03-10 14:52:02 -07:00
|
|
|
diesel::joinable!(governor_entries -> governors (governor_id));
|
|
|
|
diesel::joinable!(governors -> projects (project_id));
|
|
|
|
diesel::joinable!(governors -> teams (team_id));
|
2025-02-26 13:10:27 -08:00
|
|
|
diesel::joinable!(messages -> channels (channel_id));
|
2025-03-08 22:18:24 -08:00
|
|
|
diesel::joinable!(messages -> projects (project_id));
|
2025-02-26 13:10:50 -08:00
|
|
|
diesel::joinable!(projects -> teams (team_id));
|
2025-04-12 23:05:39 -07:00
|
|
|
diesel::joinable!(team_invitations -> teams (team_id));
|
|
|
|
diesel::joinable!(team_invitations -> users (created_by));
|
2025-02-26 13:10:50 -08:00
|
|
|
diesel::joinable!(team_memberships -> teams (team_id));
|
|
|
|
diesel::joinable!(team_memberships -> users (user_id));
|
|
|
|
|
|
|
|
diesel::allow_tables_to_appear_in_same_query!(
|
|
|
|
api_keys,
|
|
|
|
browser_sessions,
|
2025-02-26 13:10:45 -08:00
|
|
|
channel_selections,
|
|
|
|
channels,
|
2025-02-26 13:10:50 -08:00
|
|
|
csrf_tokens,
|
2025-03-10 14:52:02 -07:00
|
|
|
governor_entries,
|
|
|
|
governors,
|
2025-02-26 13:10:47 -08:00
|
|
|
messages,
|
2025-02-26 13:10:50 -08:00
|
|
|
projects,
|
2025-04-12 23:05:39 -07:00
|
|
|
team_invitations,
|
2025-02-26 13:10:50 -08:00
|
|
|
team_memberships,
|
|
|
|
teams,
|
|
|
|
users,
|
|
|
|
);
|