mirror of
https://github.com/lukevella/rallly.git
synced 2025-04-29 10:16:32 +02:00
21 lines
502 B
TypeScript
21 lines
502 B
TypeScript
import { PrismaClient } from "@prisma/client";
|
|
import { seedPolls } from "./seed/polls";
|
|
import { seedScheduledEvents } from "./seed/scheduled-events";
|
|
import { seedUsers } from "./seed/users";
|
|
|
|
const prisma = new PrismaClient();
|
|
|
|
async function main() {
|
|
const users = await seedUsers();
|
|
|
|
for (const user of users) {
|
|
await seedPolls(user.id);
|
|
await seedScheduledEvents(user.id);
|
|
}
|
|
}
|
|
|
|
main()
|
|
.catch((e) => console.error(e))
|
|
.finally(async () => {
|
|
await prisma.$disconnect();
|
|
});
|