first commit
This commit is contained in:
27
prisma/seed.ts
Normal file
27
prisma/seed.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
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);
|
||||
});
|
||||
Reference in New Issue
Block a user