Files
Keep/keep-notes/scripts/fix-recent-notes-settings.ts
Sepehr Ramezani fa7e166f3e feat: add reminders page, BMad skills upgrade, MCP server refactor
- Add reminders page with navigation support
- Upgrade BMad builder module to skills-based architecture
- Refactor MCP server: extract tools and auth into separate modules
- Add connections cache, custom AI provider support
- Update prisma schema and generated client
- Various UI/UX improvements and i18n updates
- Add service worker for PWA support

Made-with: Cursor
2026-04-13 21:02:53 +02:00

40 lines
1.1 KiB
TypeScript

import { PrismaClient } from '../prisma/client-generated'
const prisma = new PrismaClient()
async function main() {
console.log('Updating user settings to show recent notes...')
const updateResult = await prisma.userAISettings.updateMany({
data: {
showRecentNotes: true
}
})
console.log(`Updated ${updateResult.count} user settings.`)
// Verify and Create missing
const users = await prisma.user.findMany({
include: { aiSettings: true }
})
for (const u of users) {
if (!u.aiSettings) {
console.log(`User ${u.id} has no settings. Creating default...`)
await prisma.userAISettings.create({
data: {
userId: u.id,
showRecentNotes: true
}
})
console.log(`Created settings for ${u.id}`)
} else {
console.log(`User ${u.id}: showRecentNotes = ${u.aiSettings.showRecentNotes}`)
}
}
}
main()
.catch(e => console.error(e))
.finally(async () => await prisma.$disconnect())