mirror of
https://github.com/Mintplex-Labs/anything-llm.git
synced 2024-11-19 12:40:09 +01:00
be6289d141
* 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>
32 lines
699 B
JavaScript
32 lines
699 B
JavaScript
const { PrismaClient } = require("@prisma/client");
|
|
const prisma = new PrismaClient();
|
|
|
|
async function main() {
|
|
const settings = [
|
|
{ label: "multi_user_mode", value: "false" },
|
|
{ label: "logo_filename", value: "anything-llm.png" },
|
|
];
|
|
|
|
for (let setting of settings) {
|
|
const existing = await prisma.system_settings.findUnique({
|
|
where: { label: setting.label },
|
|
});
|
|
|
|
// Only create the setting if it doesn't already exist
|
|
if (!existing) {
|
|
await prisma.system_settings.create({
|
|
data: setting,
|
|
});
|
|
}
|
|
}
|
|
}
|
|
|
|
main()
|
|
.catch((e) => {
|
|
console.error(e);
|
|
process.exit(1);
|
|
})
|
|
.finally(async () => {
|
|
await prisma.$disconnect();
|
|
});
|