Files
event-qr/prisma/seed.ts
2025-11-29 12:26:58 +01:00

28 lines
542 B
TypeScript

import { PrismaClient } from '@prisma/client';
const prisma = new PrismaClient();
async function main() {
const event = await prisma.event.upsert({
where: { id: 'default-event' },
update: {},
create: {
id: 'default-event',
name: 'Default Event',
date: '2025-01-01',
location: 'Main Hall',
},
});
console.log({ event });
}
main()
.then(async () => {
await prisma.$disconnect();
})
.catch(async (e) => {
console.error(e);
await prisma.$disconnect();
process.exit(1);
});