AFFiNE/apps/server/scripts/init-db.ts

20 lines
409 B
TypeScript
Raw Normal View History

2023-04-19 02:14:25 +03:00
import userA from '@affine-test/fixtures/userA.json' assert { type: 'json' };
import { PrismaClient } from '@prisma/client';
const prisma = new PrismaClient();
async function main() {
await prisma.user.create({
data: userA,
2023-04-19 02:14:25 +03:00
});
}
main()
.then(async () => {
await prisma.$disconnect();
})
.catch(async e => {
console.error(e);
await prisma.$disconnect();
process.exit(1);
});