11 lines
508 B
JavaScript
11 lines
508 B
JavaScript
import prisma from './src/lib/prisma';
|
|
async function main() {
|
|
const brand = await prisma.productBrand.findFirst({ where: { name: 'DDC' } });
|
|
let cat = await prisma.category.findFirst({ where: { name: 'Sprockets' } });
|
|
if (!cat) {
|
|
cat = await prisma.category.create({ data: { name: 'Sprockets' } });
|
|
}
|
|
console.log(JSON.stringify({ brandId: brand?.id, catId: cat.id }));
|
|
}
|
|
main().catch(console.error).finally(() => process.exit(0));
|
|
//# sourceMappingURL=scratch_seed_product.js.map
|