Files
AnimeTV-Backend/prisma/seed/index.ts
2026-01-21 10:26:31 +07:00

26 lines
657 B
TypeScript

import { prisma } from "../../src/utils/databases/prisma/connection";
import { userRoleSeed } from "./userRole.seed";
import { userSystemSeed } from "./userSystem.seed";
async function main() {
console.log("🌱 Running all seeds...");
console.log("🔌 Connecting to database...");
const systemUserId = await userSystemSeed();
await userRoleSeed(systemUserId.id);
console.log("🌳 All seeds completed");
}
main()
.catch((e) => {
console.error(e);
process.exit(1);
})
.finally(async () => {
console.log(
"🔌 Disconnecting from database (this may take a few seconds)...",
);
await prisma.$disconnect();
});