import { PrismaClient } from '@prisma/client' const prisma = new PrismaClient() async function main() { const OLD_COLOR = '#75B2D6' const NEW_COLOR = '#A47148' console.log(`Updating colors from ${OLD_COLOR} to ${NEW_COLOR}...`) // Update Notebooks const updatedNotebooks = await prisma.notebook.updateMany({ where: { color: OLD_COLOR }, data: { color: NEW_COLOR } }) console.log(`Updated ${updatedNotebooks.count} notebooks.`) // Update Labels (if any use this color) const updatedLabels = await prisma.label.updateMany({ where: { color: OLD_COLOR }, data: { color: NEW_COLOR } }) console.log(`Updated ${updatedLabels.count} labels.`) // Update Notes (some notes might have this as a string color in metadata or field) // Note.color is usually "default", but let's check const updatedNotes = await prisma.note.updateMany({ where: { color: OLD_COLOR }, data: { color: NEW_COLOR } }) console.log(`Updated ${updatedNotes.count} notes.`) } main() .catch(e => { console.error(e) process.exit(1) }) .finally(async () => { await prisma.$disconnect() })