You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
699 B

11 months ago
  1. const { PrismaClient } = require("@prisma/client");
  2. const prisma = new PrismaClient();
  3. async function main() {
  4. const settings = [
  5. { label: "multi_user_mode", value: "false" },
  6. { label: "logo_filename", value: "anything-llm.png" },
  7. ];
  8. for (let setting of settings) {
  9. const existing = await prisma.system_settings.findUnique({
  10. where: { label: setting.label },
  11. });
  12. // Only create the setting if it doesn't already exist
  13. if (!existing) {
  14. await prisma.system_settings.create({
  15. data: setting,
  16. });
  17. }
  18. }
  19. }
  20. main()
  21. .catch((e) => {
  22. console.error(e);
  23. process.exit(1);
  24. })
  25. .finally(async () => {
  26. await prisma.$disconnect();
  27. });