update lang
This commit is contained in:
1 parent
46f00c76a4
commit
f5b60ff63e
30 files changed
+546
-652
No files matched your search
@@ -220,6 +220,8 @@ model StoreSettings {
|
||||
newsletterDescription String?
|
||||
newsletterPlaceholder String?
|
||||
newsletterButtonText String?
|
||||
footerSupportHeading Json?
|
||||
footerCopyrightText Json?
|
||||
translations StoreSettingsTranslation[]
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
@@ -98,6 +98,29 @@ async function main() {
|
||||
});
|
||||
process.stdout.write('✅ Seeded Admin User (admin / homaroma123).\n');
|
||||
|
||||
// 0.5 Seed Core Menus
|
||||
const coreMenus = [
|
||||
{ name: "main", items: [{ id: 1, label: "Home", url: "/", order: 1 }, { id: 2, label: "Shop", url: "/shop", order: 2 }, { id: 3, label: "Scent Guide", url: "/scent-guide", order: 3 }, { id: 4, label: "About Us", url: "/about", order: 4 }] },
|
||||
{ name: "footer-explore", items: [{ id: 5, label: "Home", url: "/", order: 1 }, { id: 6, label: "Shop", url: "/shop", order: 2 }, { id: 7, label: "Scent Guide", url: "/scent-guide", order: 3 }, { id: 8, label: "About Us", url: "/about", order: 4 }] },
|
||||
{ name: "footer-support", items: [{ id: 9, label: "Track Order", url: "/track-order", order: 1 }, { id: 10, label: "FAQ", url: "/faq", order: 2 }, { id: 11, label: "Contact Us", url: "/contact", order: 3 }, { id: 12, label: "Delivery & Returns", url: "/delivery", order: 4 }] }
|
||||
];
|
||||
|
||||
for (const menu of coreMenus) {
|
||||
const m = await prisma.menu.upsert({
|
||||
where: { name: menu.name },
|
||||
update: {},
|
||||
create: { name: menu.name }
|
||||
});
|
||||
for (const item of menu.items) {
|
||||
await prisma.menuItem.upsert({
|
||||
where: { id: item.id },
|
||||
update: { label: item.label, url: item.url, order: item.order, menuId: m.id },
|
||||
create: { id: item.id, label: item.label, url: item.url, order: item.order, menuId: m.id }
|
||||
});
|
||||
}
|
||||
}
|
||||
process.stdout.write('✅ Seeded Core Menus.\n');
|
||||
|
||||
// 1. Seed Scents & Categories
|
||||
const scents = [];
|
||||
for (const name of scentNames) {
|
||||
@@ -215,6 +238,11 @@ async function main() {
|
||||
process.stdout.write(` - Categories: ${categories.length}\n`);
|
||||
process.stdout.write(` - Products: ${productCount}\n`);
|
||||
process.stdout.write(` - Variants: ${variantCount}\n`);
|
||||
// Fix PostgreSQL sequence desync for tables where we hardcoded IDs
|
||||
process.stdout.write('🔄 Resetting sequences for hardcoded ID tables...\n');
|
||||
await prisma.$executeRawUnsafe(`SELECT setval('"MenuItem_id_seq"', COALESCE((SELECT MAX(id) FROM "MenuItem") + 1, 1), false);`);
|
||||
await prisma.$executeRawUnsafe(`SELECT setval('"ProductImage_id_seq"', COALESCE((SELECT MAX(id) FROM "ProductImage") + 1, 1), false);`);
|
||||
process.stdout.write('✅ Sequences reset successfully.\n');
|
||||
}
|
||||
|
||||
main()
|
||||
|
||||
Reference in new issue
Block a user