From 7dac572faaf1eae9e118961737e6aea22005faa1 Mon Sep 17 00:00:00 2001 From: Vladimir Avtsenov Date: Sun, 19 Nov 2023 13:05:19 +0300 Subject: [PATCH 1/2] retrieving lost tables --- SQL/tgstation_schema.sql | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/SQL/tgstation_schema.sql b/SQL/tgstation_schema.sql index 0186af8c2..29149339e 100644 --- a/SQL/tgstation_schema.sql +++ b/SQL/tgstation_schema.sql @@ -450,6 +450,33 @@ CREATE TABLE `schema_revision` ( PRIMARY KEY (`major`, `minor`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; +DROP TABLE IF EXISTS `custom_items`; +CREATE TABLE `custom_items` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `ckey` varchar(32) NOT NULL, + `charactername` varchar(250) NOT NULL, + `rolename` varchar(250) NOT NULL, + `itempath` varchar(250) NOT NULL, + `description` varchar(250), + PRIMARY KEY (`id`); +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +DROP TABLE IF EXISTS `role_whitelist`; +CREATE TABLE `role_whitelist` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `ckey` varchar(32) NOT NULL, + `whitelist` varchar(50) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +DROP TABLE IF EXISTS `donations`; +CREATE TABLE `donations` ( + `id` INT(11) NOT NULL AUTO_INCREMENT, + `byond` varchar(32) NOT NULL, + `sum` INT NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + DELIMITER $$ CREATE TRIGGER `role_timeTlogupdate` AFTER UPDATE ON `role_time` FOR EACH ROW BEGIN INSERT into role_time_log (ckey, job, delta) VALUES (NEW.CKEY, NEW.job, NEW.minutes-OLD.minutes); END From 5d64755f6676430b271b5ca4288e65b601f05e64 Mon Sep 17 00:00:00 2001 From: Vladimir Avtsenov Date: Sun, 19 Nov 2023 13:06:05 +0300 Subject: [PATCH 2/2] rename `donations.byond` into `donations.ckey` --- SQL/tgstation_schema.sql | 2 +- fallout13/donat/_donations.dm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/SQL/tgstation_schema.sql b/SQL/tgstation_schema.sql index 29149339e..ea9abea70 100644 --- a/SQL/tgstation_schema.sql +++ b/SQL/tgstation_schema.sql @@ -472,7 +472,7 @@ CREATE TABLE `role_whitelist` ( DROP TABLE IF EXISTS `donations`; CREATE TABLE `donations` ( `id` INT(11) NOT NULL AUTO_INCREMENT, - `byond` varchar(32) NOT NULL, + `ckey` varchar(32) NOT NULL, `sum` INT NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; diff --git a/fallout13/donat/_donations.dm b/fallout13/donat/_donations.dm index f3e8877ee..ae5176b47 100644 --- a/fallout13/donat/_donations.dm +++ b/fallout13/donat/_donations.dm @@ -148,7 +148,7 @@ GLOBAL_LIST_EMPTY(donators) if(!SSdbcore.IsConnected()) return 0 - var/datum/DBQuery/query_donators = SSdbcore.NewQuery("SELECT round(sum) FROM donations WHERE byond='[ckey]'") + var/datum/DBQuery/query_donators = SSdbcore.NewQuery("SELECT round(sum) FROM donations WHERE ckey='[ckey]'") query_donators.Execute() while(query_donators.NextRow()) var/money = round(text2num(query_donators.item[1]))