-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcleardb.js
107 lines (91 loc) · 2.07 KB
/
cleardb.js
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
const mysql = require('./api/database');
const Message = require("./api/message");
const prefix = "nstats_";
const tables = [
"ace_joins",
"ace_kicks",
"ace_players",
"ace_screenshots",
"ace_sshot_requests",
"assault_match_objectives",
"assault_objects",
"countries",
"ctf_assists",
"ctf_caps",
"ctf_cap_records",
"ctf_carry_times",
"ctf_covers",
"ctf_cr_kills",
"ctf_events",
"ctf_flag_deaths",
"ctf_flag_drops",
"ctf_flag_pickups",
"ctf_returns",
"ctf_seals",
"ctf_self_covers",
"dom_control_points",
"dom_match_caps",
"dom_match_control_points",
"dom_match_player_score",
"faces",
"gametypes",
"headshots",
//"items",
"items_match",
"items_player",
"kills",
"logs",
"maps",
"maps_flags",
"map_combogib",
"map_spawns",
"matches",
"match_combogib",
"match_connections",
"match_pings",
"match_player_score",
"match_team_changes",
"monsters",
"monsters_match",
"monsters_player_match",
"monsters_player_totals",
"monster_kills",
"nexgen_stats_viewer",
"player_combogib",
"player_ctf_best",
"player_ctf_best_life",
"player_ctf_match",
"player_ctf_totals",
"player_maps",
"player_matches",
"player_totals",
"player_weapon_match",
"player_weapon_totals",
"powerups",
"powerups_carry_times",
"powerups_player_match",
"powerups_player_totals",
"ranking_player_current",
"ranking_player_history",
"servers",
"sprees",
"voices",
"weapons",
"winrates",
"winrates_latest",
];
(async () =>{
try{
new Message(`Delete everything from database, this is not reversible.`,"note");
for(let i = 0; i < tables.length; i++){
const t = tables[i];
const query = `TRUNCATE ${prefix}${t}`;
await mysql.simpleQuery(query);
new Message(query, "pass");
}
process.exit();
}catch(err){
console.trace(err);
new Message(err, 'error');
}
})()