Added table and general functions for stats system #21
Open
waifu
wants to merge 8 commits from stats_system
into dev
@ -41,6 +41,15 @@ cursor.execute(""" |
|||||||
) |
) |
||||||
""") |
""") |
||||||
|
|
||||||
|
cursor.execute(''' |
||||||
|
CREATE TABLE IF NOT EXISTS character_stats ( |
||||||
VD15
commented 1 week ago
Review
Would we not want to extend the characters table? We could just sub in random values for stats:
Replace 9999 with whatever the limit for that stat is
waifu
commented 5 days ago
Review
Perfect, I'll add a new section in the config file for this so we can change it later. |
|||||||
|
character_id INTEGER PRIMARY KEY, |
||||||
|
power INTEGER NOT NULL DEFAULT abs(random() % 9999), |
||||||
|
charm INTEGER NOT NULL DEFAULT abs(random() % 9999),, |
||||||
|
FOREIGN KEY(character_id) REFERENCES characters(id) |
||||||
|
) |
||||||
|
''') |
||||||
|
|
||||||
# Initialize essential config key |
# Initialize essential config key |
||||||
cursor.execute('INSERT INTO config VALUES ("last_seen_notif_id", 0)') |
cursor.execute('INSERT INTO config VALUES ("last_seen_notif_id", 0)') |
||||||
|
|
||||||
|
Loading…
Reference in new issue
We don't need three different methods of retrieving the same data. We can get away with just
get_character_stats(...)
or ideally aget_character(...)
function that returns the lot.Turning these into a get_characters(...) instead, we don't have a function that receives the ids and retrieves the character(s) information, seemed more useful.