init commit,

This commit is contained in:
louiscklaw
2025-05-28 09:55:51 +08:00
commit efe70ceb69
8042 changed files with 951668 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
import { PrismaClient } from '@prisma/client';
const prisma = new PrismaClient();
async function superuser() {
const admin1 = await prisma.user.upsert({
where: { email: 'admin1@123.com' },
update: {},
create: {
email: 'admin1@123.com',
name: 'Admin1',
password: 'Aa12345678'
}
});
// swagger test
const swaggerUser = await prisma.user.upsert({
where: { email: 'fake@example.com' },
update: {},
create: {
email: 'fake@example.com',
name: 'swagger user',
password: 'password1'
}
});
console.log('seed superuser done');
}
const superuserSeed = superuser()
.then(async () => {
await prisma.$disconnect();
})
.catch(async (e) => {
console.error(e);
await prisma.$disconnect();
process.exit(1);
});
export { superuserSeed };