-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest-prisma.js
More file actions
38 lines (36 loc) · 1.04 KB
/
test-prisma.js
File metadata and controls
38 lines (36 loc) · 1.04 KB
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
35
36
37
38
const { PrismaClient } = require('@prisma/client');
const prisma = new PrismaClient();
async function main() {
try {
const data = {
name: "Test API Project",
slug: "test-api-" + Date.now(),
description: "Testing",
category: "CLIMATE",
location: "Global",
website: "https://example.com",
twitter: "",
github: "",
karmaLink: "",
milestones: "Milestone",
impactDescription: "Impact text",
logo: "url",
banner: "url",
images: [],
fundingGoal: null,
walletAddress: "0x123",
status: 'PENDING',
featured: false,
totalRaised: 0,
tipCount: 0,
submittedBy: "0xabc"
};
const project = await prisma.project.create({ data });
console.log("Success:", project);
} catch (e) {
console.error("Prisma error:", e);
} finally {
prisma.$disconnect();
}
}
main();