chore: add remaining db migration and translation scripts

This commit is contained in:
MichalC
2026-09-18 21:52:43 +02:00
parent ab8a148823
commit c8193cf166
21 changed files with 4099 additions and 0 deletions
+43
View File
@@ -0,0 +1,43 @@
import { getPayload } from 'payload'
import configPromise from '../src/payload.config'
async function run() {
const payload = await getPayload({ config: configPromise })
const home = await payload.find({ collection: 'pages', where: { slug: { equals: 'home' } }, locale: 'pl' })
if (home.docs[0] && home.docs[0].layout) {
const enLayout = home.docs[0].layout.map(block => {
// Remove id so Payload generates a new one
const { id, blockName, ...rest } = block as any
if (rest.blockType === 'hero') {
return {
...rest,
title: 'Your Trusted Accounting Office in Germany',
titleAccent: 'We speak English and Polish',
subtitle: 'Professional bookkeeping, tax settlements, and business consulting for companies in Germany.',
primaryCta: 'Contact Us',
secondaryCta: { text: 'Our Services', url: '/uslugi' }
}
}
return rest
})
try {
await payload.update({
collection: 'pages',
id: home.docs[0].id,
locale: 'en',
data: {
title: 'Accounting Services in Germany',
layout: enLayout
}
})
console.log("Successfully fixed EN home page")
} catch (e) {
console.error("Error fixing EN home page", e)
}
}
process.exit(0)
}
run().catch(console.error)