-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.ts
More file actions
34 lines (31 loc) · 856 Bytes
/
script.ts
File metadata and controls
34 lines (31 loc) · 856 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import { PrismaClient } from "@prisma/client";
const prisma = new PrismaClient();
async function main() {
let i = 1
while (i <= 369) {
let stringI = `${i}`;
if (i < 10) {
stringI = `00${i}`;
}
if (i > 10 && i < 100) {
stringI = `0${i}`;
}
await prisma.assets.create({
data: {
url: `https://ipfs.io/ipfs/Qmdg1ZGrHV2HmHBJkfSka2AuGcL3fU8BKidEbJSBCbVvfc/BIXCIP_${stringI}.jpg`,
title: `BIXCIP #${i}`,
description: `This is BIXCIP #${i}`
}
});
i++;
}
const assets = await prisma.assets.findMany();
console.log(assets);
}
main().then(async () => {
await prisma.$disconnect();
}).catch(async (e) => {
console.log(e);
await prisma.$disconnect();
process.exit(1);
})