File: create_test_users.sql

package info (click to toggle)
pokerth 2.0.6-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 64,020 kB
  • sloc: ansic: 94,844; cpp: 59,414; java: 3,135; sh: 2,054; xml: 643; sql: 46; makefile: 12
file content (59 lines) | stat: -rw-r--r-- 1,143 bytes parent folder | download
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
-- PokerTH Test Users - Manual SQL Template
-- Verwendung: Passe die Anzahl an und führe in MySQL aus

-- AES Key - REPLACE WITH YOUR KEY!
SET @aes_key = 'YOUR_AES_KEY_HERE';

-- Beispiel: test1 erstellen
DELETE FROM player WHERE username = 'test1';
DELETE FROM player_ranking WHERE username = 'test1';

INSERT INTO player (
    username, 
    password, 
    email, 
    created, 
    active, 
    blocked
) VALUES (
    'test1',
    AES_ENCRYPT('test1', @aes_key),
    'test1@pokerth.test',
    NOW(),
    1,
    0
);

INSERT INTO player_ranking (
    player_id,
    final_score,
    username,
    points_sum,
    season_games,
    average_score
) VALUES (
    LAST_INSERT_ID(),
    -1,
    'test1',
    0,
    0,
    0
);

-- Wiederholen für test2, test3, etc.
-- Oder Bash-Script verwenden: ./create_test_users.sh

-- Verification Query
SELECT 
    p.player_id,
    p.username,
    AES_DECRYPT(p.password, @aes_key) as decrypted_password,
    p.email,
    p.active,
    pr.season_games,
    pr.points_sum
FROM player p
LEFT JOIN player_ranking pr ON p.player_id = pr.player_id
WHERE p.username LIKE 'test%'
ORDER BY p.player_id
LIMIT 10;