Skip to content

Commit

Permalink
JSON feedback (tgstation#32188)
Browse files Browse the repository at this point in the history
* wip

* wip2

* makes code actually compile on 511 + fixes

* versioning

* s

* adds python conversion script, schema change and removes 'force ' from item_used_for_combat

* fix to compile

* forgot to actually commit this
  • Loading branch information
Jordie0608 authored and ninjanomnom committed Nov 17, 2017
1 parent b04b272 commit 8b19b49
Show file tree
Hide file tree
Showing 106 changed files with 1,109 additions and 645 deletions.
25 changes: 22 additions & 3 deletions SQL/database_changelog.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,34 @@
Any time you make a change to the schema files, remember to increment the database schema version. Generally increment the minor number, major should be reserved for significant changes to the schema. Both values go up to 255.

The latest database version is 3.4; The query to update the schema revision table is:
The latest database version is 4.0; The query to update the schema revision table is:

INSERT INTO `schema_revision` (`major`, `minor`) VALUES (3, 4);
INSERT INTO `schema_revision` (`major`, `minor`) VALUES (4, 0);
or
INSERT INTO `SS13_schema_revision` (`major`, `minor`) VALUES (3, 4);
INSERT INTO `SS13_schema_revision` (`major`, `minor`) VALUES (4, 0);

In any query remember to add a prefix to the table names if you use one.

----------------------------------------------------

12 November 2017, by Jordie0608
Modified feedback table to use json, a python script is used to migrate data to this new format.

See the file 'feedback_conversion_2017-11-12.py' for instructions on how to use the script.

A new json feedback table can be created with:
CREATE TABLE `feedback` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`datetime` datetime NOT NULL,
`round_id` int(11) unsigned NOT NULL,
`key_name` varchar(32) NOT NULL,
`key_type` enum('text', 'amount', 'tally', 'nested tally', 'associative') NOT NULL,
`version` tinyint(3) unsigned NOT NULL,
`json` json NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM

----------------------------------------------------

28 August 2017, by MrStonedOne
Modified table 'messages', adding a deleted column and editing all indexes to include it

Expand Down
532 changes: 532 additions & 0 deletions SQL/feedback_conversion_2017-11-12.py

Large diffs are not rendered by default.

13 changes: 7 additions & 6 deletions SQL/tgstation_schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -163,12 +163,13 @@ DROP TABLE IF EXISTS `feedback`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `feedback` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`time` datetime NOT NULL,
`round_id` int(8) NOT NULL,
`var_name` varchar(32) NOT NULL,
`var_value` int(16) DEFAULT NULL,
`details` text,
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`datetime` datetime NOT NULL,
`round_id` int(11) unsigned NOT NULL,
`key_name` varchar(32) NOT NULL,
`key_type` enum('text', 'amount', 'tally', 'nested tally', 'associative') NOT NULL,
`version` tinyint(3) unsigned NOT NULL,
`json` json NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
Expand Down
13 changes: 7 additions & 6 deletions SQL/tgstation_schema_prefixed.sql
Original file line number Diff line number Diff line change
Expand Up @@ -163,12 +163,13 @@ DROP TABLE IF EXISTS `SS13_feedback`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SS13_feedback` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`time` datetime NOT NULL,
`round_id` int(8) NOT NULL,
`var_name` varchar(32) NOT NULL,
`var_value` int(16) DEFAULT NULL,
`details` text,
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`datetime` datetime NOT NULL,
`round_id` int(11) unsigned NOT NULL,
`key_name` varchar(32) NOT NULL,
`version` tinyint(3) unsigned NOT NULL,
`key_type` enum('text', 'amount', 'tally', 'nested tally', 'associative') NOT NULL,
`json` json NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
Expand Down
4 changes: 2 additions & 2 deletions code/_compile_options.dm
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,5 @@

//Update this whenever the db schema changes
//make sure you add an update to the schema_version stable in the db changelog
#define DB_MAJOR_VERSION 3
#define DB_MINOR_VERSION 4
#define DB_MAJOR_VERSION 4
#define DB_MINOR_VERSION 0
4 changes: 2 additions & 2 deletions code/controllers/admin.dm
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ INITIALIZE_IMMEDIATE(/obj/effect/statclick)
switch(controller)
if("Master")
Recreate_MC()
SSblackbox.add_details("admin_verb","Restart Master Controller")
SSblackbox.record_feedback("tally", "admin_verb", 1, "Restart Master Controller")
if("Failsafe")
new /datum/controller/failsafe()
SSblackbox.add_details("admin_verb","Restart Failsafe Controller")
SSblackbox.record_feedback("tally", "admin_verb", 1, "Restart Failsafe Controller")

message_admins("Admin [key_name_admin(usr)] has restarted the [controller] controller.")
Loading

0 comments on commit 8b19b49

Please sign in to comment.