Initial commit: LACA parking management system
This commit is contained in:
23
backend/prisma/seed.ts
Normal file
23
backend/prisma/seed.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import { PrismaClient } from '@prisma/client';
|
||||
import tenant from './tenant';
|
||||
// initialize the Prisma Client
|
||||
const prisma = new PrismaClient();
|
||||
|
||||
async function main() {
|
||||
// create two dummy articles
|
||||
return prisma.$transaction(async (tx: PrismaClient) => {
|
||||
console.log('Seeding...');
|
||||
await tenant(tx);
|
||||
});
|
||||
}
|
||||
|
||||
// execute the main function
|
||||
main()
|
||||
.catch((e) => {
|
||||
console.error(e);
|
||||
process.exit(1);
|
||||
})
|
||||
.finally(async () => {
|
||||
// close the Prisma Client at the end
|
||||
await prisma.$disconnect();
|
||||
});
|
||||
Reference in New Issue
Block a user