mirror of
https://github.com/Mintplex-Labs/anything-llm.git
synced 2026-06-12 13:15:38 +03:00
Daily message limit per user (#2417)
* set message limit per user * remove old limit user messages + unused admin page * fix daily message validation * refactor message limit input refactor canSendChat on user to a method on user model --------- Co-authored-by: timothycarambat <rambat1010@gmail.com>
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
-- AlterTable
|
||||
ALTER TABLE "users" ADD COLUMN "dailyMessageLimit" INTEGER;
|
||||
@@ -67,6 +67,7 @@ model users {
|
||||
seen_recovery_codes Boolean? @default(false)
|
||||
createdAt DateTime @default(now())
|
||||
lastUpdatedAt DateTime @default(now())
|
||||
dailyMessageLimit Int?
|
||||
workspace_chats workspace_chats[]
|
||||
workspace_users workspace_users[]
|
||||
embed_configs embed_configs[]
|
||||
@@ -309,4 +310,4 @@ model browser_extension_api_keys {
|
||||
user users? @relation(fields: [user_id], references: [id], onDelete: Cascade)
|
||||
|
||||
@@index([user_id])
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,8 +4,6 @@ const prisma = new PrismaClient();
|
||||
async function main() {
|
||||
const settings = [
|
||||
{ label: "multi_user_mode", value: "false" },
|
||||
{ label: "limit_user_messages", value: "false" },
|
||||
{ label: "message_limit", value: "25" },
|
||||
{ label: "logo_filename", value: "anything-llm.png" },
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user