chore: save workspace member info to disk (#5536)

* chore: save workspace member info to disk

* chore: fix clippy
This commit is contained in:
Nathan.fooo
2024-06-14 11:34:23 +08:00
committed by GitHub
parent 785597f53e
commit 27899ee993
18 changed files with 207 additions and 24 deletions

View File

@ -0,0 +1 @@
-- This file should undo anything in `up.sql`

View File

@ -0,0 +1,11 @@
-- Your SQL goes here
CREATE TABLE workspace_members_table (
email TEXT KEY NOT NULL,
role INTEGER NOT NULL,
name TEXT NOT NULL,
avatar_url TEXT,
uid BIGINT NOT NULL,
workspace_id TEXT NOT NULL,
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (email, workspace_id)
);

View File

@ -67,6 +67,18 @@ diesel::table! {
}
}
diesel::table! {
workspace_members_table (email, workspace_id) {
email -> Text,
role -> Integer,
name -> Text,
avatar_url -> Nullable<Text>,
uid -> BigInt,
workspace_id -> Text,
updated_at -> Timestamp,
}
}
diesel::allow_tables_to_appear_in_same_query!(
chat_message_table,
chat_table,
@ -74,4 +86,5 @@ diesel::allow_tables_to_appear_in_same_query!(
user_data_migration_records,
user_table,
user_workspace_table,
workspace_members_table,
);