mirror of
https://github.com/Mintplex-Labs/anything-llm.git
synced 2024-09-12 07:10:08 +02:00
34 lines
799 B
JavaScript
34 lines
799 B
JavaScript
|
const { PrismaClient } = require('@prisma/client');
|
||
|
const prisma = new PrismaClient();
|
||
|
|
||
|
async function main() {
|
||
|
const settings = [
|
||
|
{ label: 'multi_user_mode', value: 'false' },
|
||
|
{ label: 'users_can_delete_workspaces', value: 'false' },
|
||
|
{ label: 'limit_user_messages', value: 'false' },
|
||
|
{ label: 'message_limit', value: '25' },
|
||
|
];
|
||
|
|
||
|
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();
|
||
|
});
|