This commit is contained in:
Nông Đức Huy
2026-08-13 23:20:22 +07:00
parent 3d6b0e0d4e
commit 5386bc51d1
65 changed files with 4058 additions and 161 deletions
+14
View File
@@ -9,6 +9,7 @@
import { PrismaClient } from '@prisma/client';
import { ALL_PERMISSIONS, PERMISSIONS, SYSTEM_ROLES, type Permission } from '@sport/types';
import { seedDevAccounts } from './seed/accounts';
import { seedCatalog } from './seed/catalog';
const prisma = new PrismaClient();
@@ -144,6 +145,19 @@ async function main(): Promise<void> {
}
await seedCatalog(prisma);
const accounts = await seedDevAccounts(prisma);
const created = accounts.filter((account) => account.created);
if (created.length > 0) {
console.log('\nDevelopment sign-in accounts (shown once):\n');
for (const account of created) {
console.log(` ${account.email.padEnd(24)} ${account.password} [${account.role}]`);
}
console.log('\n Development only. Use `pnpm db:create-admin` for real environments.\n');
} else {
console.log('Development accounts already exist; passwords left unchanged.');
}
}
main()