-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate_admin_user.sql
More file actions
73 lines (66 loc) · 1.6 KB
/
create_admin_user.sql
File metadata and controls
73 lines (66 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
-- =====================================================
-- ResulogicX Admin User Creation Script
-- =====================================================
-- Run this in pgAdmin to create the default admin user
--
-- Credentials:
-- Email: admin@resulogic.org
-- Password: Admin@12345
-- =====================================================
BEGIN;
-- 1. Delete existing admin if it exists (optional - comment out if you want to keep existing)
DELETE FROM users WHERE email = 'admin@resulogic.org' AND role = 'ADMIN';
-- 2. Insert the admin user
INSERT INTO users (
first_name,
last_name,
email,
password,
role,
status,
email_verified,
country,
gender,
age_group,
created_at,
updated_at
) VALUES (
'Super',
'Admin',
'admin@resulogic.org',
'$2a$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2uheWG/igi.', -- BCrypt hash for: Admin@12345
'ADMIN',
'ACTIVE',
true,
'N/A',
'N/A',
'NOT_SPECIFIED',
CURRENT_TIMESTAMP,
CURRENT_TIMESTAMP
);
-- 3. Verify the admin was created
SELECT
id,
first_name,
last_name,
email,
role,
status,
email_verified,
created_at
FROM users
WHERE email = 'admin@resulogic.org';
COMMIT;
-- =====================================================
-- Expected Output:
-- Should show one row with:
-- - first_name: Super
-- - last_name: Admin
-- - email: admin@resulogic.org
-- - role: ADMIN
-- - status: ACTIVE
-- - email_verified: true
-- =====================================================
-- Login Credentials:
-- Email: admin@resulogic.org
-- Password: Admin@12345