30 lines
1.7 KiB
SQL
30 lines
1.7 KiB
SQL
-- Rank history: one row each time a player's rank (their highest-immunity SimpleAdmin group)
|
|
-- changes, for the public promotions/demotions list.
|
|
--
|
|
-- The panel creates this table itself at startup (it's embedded in the binary), so running it by
|
|
-- hand is only needed if the panel's database user can't CREATE TABLE. Written by the panel for
|
|
-- changes made there, and by our SimpleAdmin fork (1.8.2b-zio10+) for css_addadmin/css_deladmin
|
|
-- and the in-game admin menu. Nothing writes it for ranks that lapse when an admin's `ends` passes.
|
|
--
|
|
-- kind is added, removed, promoted, demoted (compared by group immunity) or changed (same
|
|
-- immunity). The panel overrides it when listing changes involving an inactive rank (one marked
|
|
-- "inactive" in its site config, like Guardian): moving between an inactive rank and any other
|
|
-- rank shows as promoted either way, and losing an inactive rank shows as demoted. old_rank/new_rank are group names ("#rank/mod"), NULL for no
|
|
-- rank. admin_steamid 0 is Console. created is a wall-clock value in SimpleAdmin's Timezone, like
|
|
-- its other tables.
|
|
|
|
CREATE TABLE IF NOT EXISTS `sa_rank_log` (
|
|
`id` int(11) NOT NULL AUTO_INCREMENT,
|
|
`player_steamid` bigint(20) NOT NULL,
|
|
`player_name` varchar(128) NOT NULL DEFAULT '',
|
|
`old_rank` varchar(64) NULL,
|
|
`new_rank` varchar(64) NULL,
|
|
`kind` varchar(16) NOT NULL,
|
|
`admin_steamid` bigint(20) NOT NULL DEFAULT 0,
|
|
`admin_name` varchar(128) NOT NULL DEFAULT '',
|
|
`source` varchar(16) NOT NULL,
|
|
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
PRIMARY KEY (`id`),
|
|
KEY `idx_rank_log_created` (`created`),
|
|
KEY `idx_rank_log_player` (`player_steamid`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|