@opprs/db-prisma 2.2.0 → 2.2.1-canary.c7c3fc7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -3
- package/prisma/seed.ts +20 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opprs/db-prisma",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.1-canary.c7c3fc7",
|
|
4
4
|
"description": "Database backend for OPPR (Open Pinball Player Ranking System) using Prisma and PostgreSQL",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"oppr",
|
|
@@ -56,10 +56,10 @@
|
|
|
56
56
|
"vitest": "^4.0.16"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
|
-
"@opprs/core": "^
|
|
59
|
+
"@opprs/core": "^2.2.1-canary.c7c3fc7"
|
|
60
60
|
},
|
|
61
61
|
"engines": {
|
|
62
|
-
"node": ">=
|
|
62
|
+
"node": ">=20.9.0"
|
|
63
63
|
},
|
|
64
64
|
"prisma": {
|
|
65
65
|
"seed": "tsx prisma/seed.ts"
|
package/prisma/seed.ts
CHANGED
|
@@ -112,6 +112,26 @@ async function main() {
|
|
|
112
112
|
|
|
113
113
|
console.log(`✓ Created test user (e2e-test@example.com / ${testPassword})`);
|
|
114
114
|
|
|
115
|
+
// Create admin user
|
|
116
|
+
console.log('Creating admin user...');
|
|
117
|
+
const adminPassword = 'AdminPassword123!';
|
|
118
|
+
const adminPasswordHash = await bcrypt.hash(adminPassword, BCRYPT_SALT_ROUNDS);
|
|
119
|
+
|
|
120
|
+
await prisma.user.upsert({
|
|
121
|
+
where: { email: 'admin@example.com' },
|
|
122
|
+
update: {
|
|
123
|
+
passwordHash: adminPasswordHash,
|
|
124
|
+
role: 'ADMIN',
|
|
125
|
+
},
|
|
126
|
+
create: {
|
|
127
|
+
email: 'admin@example.com',
|
|
128
|
+
passwordHash: adminPasswordHash,
|
|
129
|
+
role: 'ADMIN',
|
|
130
|
+
},
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
console.log(`✓ Created admin user (admin@example.com / ${adminPassword})`);
|
|
134
|
+
|
|
115
135
|
// Create sample tournaments (using upsert for idempotency)
|
|
116
136
|
console.log('Creating tournaments...');
|
|
117
137
|
|