adds more round id tracking

This commit is contained in:
Jordie0608
2017-08-25 22:05:32 +10:00
parent 988d67b5d0
commit b7341a93ae
8 changed files with 42 additions and 12 deletions

View File

@@ -1,10 +1,24 @@
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.2; The query to update the schema revision table is:
The latest database version is 3.3; The query to update the schema revision table is:
INSERT INTO `schema_revision` (`major`, `minor`) VALUES (3, 2);
INSERT INTO `schema_revision` (`major`, `minor`) VALUES (3, 3);
or
INSERT INTO `SS13_schema_revision` (`major`, `minor`) VALUES (3, 2);
INSERT INTO `SS13_schema_revision` (`major`, `minor`) VALUES (3, 3);
----------------------------------------------------
In any query remember to add a prefix to the table names if you use one.
----------------------------------------------------
25 August 2017, by Jordie0608
Modified tables 'connection_log', 'legacy_population', 'library', 'messages' and 'player' to add additional 'round_id' tracking in various forms and 'server_ip' and 'server_port' to the table 'messages'.
ALTER TABLE `connection_log` ADD COLUMN `round_id` INT(11) UNSIGNED NOT NULL AFTER `server_port`;
ALTER TABLE `legacy_population` ADD COLUMN `round_id` INT(11) UNSIGNED NOT NULL AFTER `server_port`;
ALTER TABLE `library` ADD COLUMN `round_id_created` INT(11) UNSIGNED NOT NULL AFTER `deleted`;
ALTER TABLE `messages` ADD COLUMN `server_ip` INT(10) UNSIGNED NOT NULL AFTER `server`, ADD COLUMN `server_port` SMALLINT(5) UNSIGNED NOT NULL AFTER `server_ip`, ADD COLUMN `round_id` INT(11) UNSIGNED NOT NULL AFTER `server_port`;
ALTER TABLE `player` ADD COLUMN `firstseen_round_id` INT(11) UNSIGNED NOT NULL AFTER `firstseen`, ADD COLUMN `lastseen_round_id` INT(11) UNSIGNED NOT NULL AFTER `lastseen`;
----------------------------------------------------

View File

@@ -110,6 +110,7 @@ CREATE TABLE `connection_log` (
`datetime` datetime DEFAULT NULL,
`server_ip` int(10) unsigned NOT NULL,
`server_port` smallint(5) unsigned NOT NULL,
`round_id` int(11) unsigned NOT NULL,
`ckey` varchar(45) DEFAULT NULL,
`ip` int(10) unsigned NOT NULL,
`computerid` varchar(45) DEFAULT NULL,
@@ -202,6 +203,7 @@ CREATE TABLE `legacy_population` (
`time` datetime NOT NULL,
`server_ip` int(10) unsigned NOT NULL,
`server_port` smallint(5) unsigned NOT NULL,
`round_id` int(11) unsigned NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
@@ -222,6 +224,7 @@ CREATE TABLE `library` (
`ckey` varchar(32) NOT NULL DEFAULT 'LEGACY',
`datetime` datetime NOT NULL,
`deleted` tinyint(1) unsigned DEFAULT NULL,
`round_id_created` int(11) unsigned NOT NULL,
PRIMARY KEY (`id`),
KEY `deleted_idx` (`deleted`),
KEY `idx_lib_id_del` (`id`,`deleted`),
@@ -245,6 +248,9 @@ CREATE TABLE `messages` (
`text` varchar(2048) NOT NULL,
`timestamp` datetime NOT NULL,
`server` varchar(32) DEFAULT NULL,
`server_ip` int(10) unsigned NOT NULL,
`server_port` smallint(5) unsigned NOT NULL,
`round_id` int(11) unsigned NOT NULL,
`secret` tinyint(1) unsigned NOT NULL,
`lasteditor` varchar(32) DEFAULT NULL,
`edits` text,
@@ -280,7 +286,9 @@ DROP TABLE IF EXISTS `player`;
CREATE TABLE `player` (
`ckey` varchar(32) NOT NULL,
`firstseen` datetime NOT NULL,
`firstseen_round_id` int(11) unsigned NOT NULL,
`lastseen` datetime NOT NULL,
`lastseen_round_id` int(11) unsigned NOT NULL,
`ip` int(10) unsigned NOT NULL,
`computerid` varchar(32) NOT NULL,
`lastadminrank` varchar(32) NOT NULL DEFAULT 'Player',

View File

@@ -110,6 +110,7 @@ CREATE TABLE `SS13_connection_log` (
`datetime` datetime DEFAULT NULL,
`server_ip` int(10) unsigned NOT NULL,
`server_port` smallint(5) unsigned NOT NULL,
`round_id` int(11) unsigned NOT NULL,
`ckey` varchar(45) DEFAULT NULL,
`ip` int(10) unsigned NOT NULL,
`computerid` varchar(45) DEFAULT NULL,
@@ -202,6 +203,7 @@ CREATE TABLE `SS13_legacy_population` (
`time` datetime NOT NULL,
`server_ip` int(10) unsigned NOT NULL,
`server_port` smallint(5) unsigned NOT NULL,
`round_id` int(11) unsigned NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
@@ -222,6 +224,7 @@ CREATE TABLE `SS13_library` (
`ckey` varchar(32) NOT NULL DEFAULT 'LEGACY',
`datetime` datetime NOT NULL,
`deleted` tinyint(1) unsigned DEFAULT NULL,
`round_id_created` int(11) unsigned NOT NULL,
PRIMARY KEY (`id`),
KEY `deleted_idx` (`deleted`),
KEY `idx_lib_id_del` (`id`,`deleted`),
@@ -245,6 +248,9 @@ CREATE TABLE `SS13_messages` (
`text` varchar(2048) NOT NULL,
`timestamp` datetime NOT NULL,
`server` varchar(32) DEFAULT NULL,
`server_ip` int(10) unsigned NOT NULL,
`server_port` smallint(5) unsigned NOT NULL,
`round_id` int(11) unsigned NOT NULL,
`secret` tinyint(1) unsigned NOT NULL,
`lasteditor` varchar(32) DEFAULT NULL,
`edits` text,
@@ -280,7 +286,9 @@ DROP TABLE IF EXISTS `SS13_player`;
CREATE TABLE `SS13_player` (
`ckey` varchar(32) NOT NULL,
`firstseen` datetime NOT NULL,
`firstseen_round_id` int(11) unsigned NOT NULL,
`lastseen` datetime NOT NULL,
`lastseen_round_id` int(11) unsigned NOT NULL,
`ip` int(10) unsigned NOT NULL,
`computerid` varchar(32) NOT NULL,
`lastadminrank` varchar(32) NOT NULL DEFAULT 'Player',