Skip to content

Commit

Permalink
Adds the library_report table (tgstation#60599)
Browse files Browse the repository at this point in the history
* Adds the library_report table

* Updating subsystem defines

* fix table name

* Update database_changelog.txt

* Update tgstation_schema.sql

* Update tgstation_schema_prefixed.sql

Co-authored-by: Kyle Spier-Swenson <[email protected]>
Co-authored-by: Jordie <[email protected]>
  • Loading branch information
3 people authored Aug 3, 2021
1 parent 8b624aa commit ec21893
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 4 deletions.
25 changes: 22 additions & 3 deletions SQL/database_changelog.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,32 @@
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 5.14; The query to update the schema revision table is:
The latest database version is 5.16; The query to update the schema revision table is:

INSERT INTO `schema_revision` (`major`, `minor`) VALUES (5, 15);
INSERT INTO `schema_revision` (`major`, `minor`) VALUES (5, 16);
or
INSERT INTO `SS13_schema_revision` (`major`, `minor`) VALUES (5, 15);
INSERT INTO `SS13_schema_revision` (`major`, `minor`) VALUES (5, 16);

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

-----------------------------------------------------
Version 5.16, 31 July 2021, by Atlanta-Ned
Added `library_action` table for tracking reported library books and actions taken on them.

```
DROP TABLE IF EXISTS `library_action`;
CREATE TABLE `library_action` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`book` int(10) unsigned NOT NULL,
`reason` longtext DEFAULT NULL,
`ckey` varchar(11) NOT NULL DEFAULT '',
`datetime` datetime NOT NULL DEFAULT current_timestamp(),
`action` varchar(11) NOT NULL DEFAULT '',
`ip_addr` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
```


-----------------------------------------------------
Version 5.15, 2 June 2021, by Mothblocks
Added verified admin connection log used for 2FA
Expand Down
19 changes: 19 additions & 0 deletions SQL/tgstation_schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,25 @@ CREATE TABLE `library` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `library_action`
--

DROP TABLE IF EXISTS `library_action`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `library_action` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`book` int(10) unsigned NOT NULL,
`reason` longtext DEFAULT NULL,
`ckey` varchar(11) NOT NULL DEFAULT '',
`datetime` datetime NOT NULL DEFAULT current_timestamp(),
`action` varchar(11) NOT NULL DEFAULT '',
`ip_addr` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `messages`
--
Expand Down
19 changes: 19 additions & 0 deletions SQL/tgstation_schema_prefixed.sql
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,25 @@ CREATE TABLE `SS13_library` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `SS13_library_action`
--

DROP TABLE IF EXISTS `SS13_library_action`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SS13_library_action` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`book` int(10) unsigned NOT NULL,
`reason` longtext DEFAULT NULL,
`ckey` varchar(11) NOT NULL DEFAULT '',
`datetime` datetime NOT NULL DEFAULT current_timestamp(),
`action` varchar(11) NOT NULL DEFAULT '',
`ip_addr` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `SS13_messages`
--
Expand Down
2 changes: 1 addition & 1 deletion code/__DEFINES/subsystems.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*
* make sure you add an update to the schema_version stable in the db changelog
*/
#define DB_MINOR_VERSION 15
#define DB_MINOR_VERSION 16


//! ## Timing subsystem
Expand Down

0 comments on commit ec21893

Please sign in to comment.