Adjusted .idea/workspace.xml for correct recent project path and tasks. Updated seed.ts to include new cryptocurrency records and modified existing promo code details.
61 lines
926 B
TypeScript
61 lines
926 B
TypeScript
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: 'YOLO',
|
|
value: 8192,
|
|
},
|
|
});
|
|
|
|
await prisma.crypto.create({
|
|
data: {
|
|
name: 'BTC',
|
|
value: 456,
|
|
quantity: 2400,
|
|
image: "",
|
|
}
|
|
});
|
|
await prisma.crypto.create({
|
|
data: {
|
|
name: 'ETH',
|
|
value: 947,
|
|
quantity: 163,
|
|
image: "",
|
|
}
|
|
});
|
|
await prisma.crypto.create({
|
|
data: {
|
|
name: 'DOGE',
|
|
value: 1749,
|
|
quantity: 482,
|
|
image: "",
|
|
}
|
|
});
|
|
}
|
|
|
|
|
|
main()
|
|
.then(async () => {
|
|
await prisma.$disconnect();
|
|
})
|
|
.catch(async (e) => {
|
|
console.error(e);
|
|
await prisma.$disconnect();
|
|
process.exit(1);
|
|
});
|
|
|