mirror of
https://github.com/Kevsl/crypto-exchange-api.git
synced 2026-02-04 01:56:14 +01:00
updated libs and removed vulnerabilities
This commit is contained in:
33
prisma/seed.ts
Normal file
33
prisma/seed.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import { PrismaClient } from '@prisma/client';
|
||||
|
||||
const prisma = new PrismaClient();
|
||||
|
||||
async function main() {
|
||||
await prisma.role.create({
|
||||
data: {
|
||||
name: 'user',
|
||||
},
|
||||
});
|
||||
await prisma.role.create({
|
||||
data: {
|
||||
name: 'admin',
|
||||
},
|
||||
});
|
||||
|
||||
await prisma.promoCode.create({
|
||||
data: {
|
||||
name: 'PROMO1000',
|
||||
value: 1000,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
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