Files
2025-05-28 09:55:51 +08:00

32 lines
646 B
TypeScript

import { PrismaClient } from '@prisma/client';
const prisma = new PrismaClient();
async function order() {
for (let i = 0; i < 3; i++) {
const temp = await prisma.order.upsert({
where: { id: i },
update: {},
create: {
title: 'Single Party with Dating',
order_time: new Date(),
last_payment_date: new Date(),
status: 'Pending'
}
});
}
console.log('seed order done');
}
const Order = order()
.then(async () => {
await prisma.$disconnect();
})
.catch(async (e) => {
console.error(e);
await prisma.$disconnect();
process.exit(1);
});
export { Order };