Skip to content

Commit

Permalink
Merge pull request #238 from iWuna/feature/db
Browse files Browse the repository at this point in the history
Retrieving lost tables
  • Loading branch information
iWuna authored Nov 19, 2023
2 parents 50aed78 + 5d64755 commit c9af95a
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
27 changes: 27 additions & 0 deletions SQL/tgstation_schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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,
`ckey` 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
Expand Down
2 changes: 1 addition & 1 deletion fallout13/donat/_donations.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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]))
Expand Down

0 comments on commit c9af95a

Please sign in to comment.