Completely refactors Karma (#17447)

* Refactors Karma

* I FELL VICTIM TO MY OWN CI

* Update code/modules/client/client_procs.dm

* Update SQL/updates/31-32.py

* Mochi tweaks

Co-authored-by: dearmochi <1496804+dearmochi@users.noreply.github.com>

Co-authored-by: dearmochi <1496804+dearmochi@users.noreply.github.com>
This commit is contained in:
AffectedArc07
2022-03-08 22:14:05 +01:00
committed by GitHub
co-authored by dearmochi
parent e19931c643
commit 95ce462b14
21 changed files with 545 additions and 368 deletions
+18
View File
@@ -0,0 +1,18 @@
# Updates DB from 30 to 31 -AffectedArc07
# Creates new tables in preparation for karma conversion
# Rename old tables
RENAME TABLE `karma` TO `karma_log`;
RENAME TABLE `karmatotals` TO `karma_totals`;
# Create new table to track new purchases
CREATE TABLE `karma_purchases` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`ckey` VARCHAR(32) NOT NULL COLLATE 'utf8_general_ci',
`purchase` VARCHAR(64) NOT NULL COLLATE 'utf8_general_ci',
`purchase_time` DATETIME NOT NULL DEFAULT current_timestamp(),
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `ckey` (`ckey`, `purchase`) USING BTREE
) COLLATE='utf8_general_ci' ENGINE=InnoDB;
# YOU MUST NOW RUN 31-32.py