forked from Muehe/sqlua
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreature_cleanup.py
More file actions
44 lines (36 loc) · 1.13 KB
/
creature_cleanup.py
File metadata and controls
44 lines (36 loc) · 1.13 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
import config
import pymysql
trinity_connection = pymysql.connect(
host=config.dbInfo['host'],
user=config.dbInfo['user'],
password=config.dbInfo['password'],
database='trinity',
port=config.dbInfo["port"],
charset='utf8'
)
t_cursor = trinity_connection.cursor(pymysql.cursors.DictCursor)
mangos_connection = pymysql.connect(
host=config.dbInfo['host'],
user=config.dbInfo['user'],
password=config.dbInfo['password'],
database='mangos3',
port=config.dbInfo["port"],
charset='utf8'
)
m_cursor = mangos_connection.cursor(pymysql.cursors.DictCursor)
t_cursor.execute("SELECT entry from creature_template")
## Print all entries that are in trinity but not in mangos3
trinity_entries = set()
for row in t_cursor.fetchall():
trinity_entries.add(row['entry'])
mangos_entries = set()
m_cursor.execute("SELECT Entry from creature_template")
for row in m_cursor.fetchall():
mangos_entries.add(row['Entry'])
entries = trinity_entries - mangos_entries
# sort entries
entries = list(entries)
entries.sort()
print("Entries in trinity but not in mangos3:")
for entry in entries:
print(str(entry) + ",")