This should get us back on track (tested on ARCH Linux)
This commit is contained in:
@@ -38,12 +38,14 @@ class CharacterInfoController:
|
||||
def pre_start(self):
|
||||
self.bot.register_packet_handler(CharacterName.id, self.character_name_update)
|
||||
|
||||
self.db.shared.exec("CREATE TABLE IF NOT EXISTS name_history ("
|
||||
"char_id INT NOT NULL, "
|
||||
"name VARCHAR(20) NOT NULL, "
|
||||
"created_at INT NOT NULL, "
|
||||
"PRIMARY KEY (char_id, name))")
|
||||
|
||||
def start(self):
|
||||
self.db.exec("CREATE TABLE IF NOT EXISTS name_history ("
|
||||
"char_id INT NOT NULL, "
|
||||
"name VARCHAR(20) NOT NULL, "
|
||||
"created_at INT NOT NULL, "
|
||||
"PRIMARY KEY (char_id, name))")
|
||||
|
||||
self.db.create_view("name_history")
|
||||
self.command_alias_service.add_alias("w", "whois")
|
||||
self.command_alias_service.add_alias("lookup", "whois")
|
||||
@@ -155,7 +157,7 @@ class CharacterInfoController:
|
||||
with self.db.pool.get_connection() as conn:
|
||||
with conn.cursor() as cur:
|
||||
cur.executemany("INSERT IGNORE INTO name_history (char_id, name, created_at) "
|
||||
"VALUES (?, ?, ?)",
|
||||
"VALUES (%s, %s, %s)",
|
||||
self.name_history)
|
||||
self.name_history = []
|
||||
|
||||
|
||||
Reference in New Issue
Block a user