x
This commit is contained in:
1 parent
0144545166
commit
be0ee265d5
9 files changed
+43
-11
No files matched your search
@@ -6,6 +6,7 @@ const { PrismaClient } = require('@prisma/client');
|
||||
const { Pool } = require('pg');
|
||||
const { PrismaPg } = require('@prisma/adapter-pg');
|
||||
const bcrypt = require('bcryptjs');
|
||||
const seedAdmin = require('./seedAdmin.cjs');
|
||||
|
||||
const pool = new Pool({ connectionString: process.env.DATABASE_URL });
|
||||
const adapter = new PrismaPg(pool);
|
||||
@@ -86,17 +87,7 @@ async function main() {
|
||||
}
|
||||
|
||||
// 0. Seed Admin User
|
||||
const adminPassword = await bcrypt.hash('homaroma123', 10);
|
||||
await prisma.user.upsert({
|
||||
where: { username: 'admin' },
|
||||
update: { password: adminPassword },
|
||||
create: {
|
||||
username: 'admin',
|
||||
password: adminPassword,
|
||||
role: 'ADMIN'
|
||||
}
|
||||
});
|
||||
process.stdout.write('✅ Seeded Admin User (admin / homaroma123).\n');
|
||||
await seedAdmin(prisma);
|
||||
|
||||
// 0.5 Seed Core Menus
|
||||
const coreMenus = [
|
||||
|
||||
Reference in new issue
Block a user