mirror of
https://github.com/daffyyyy/CS2-SimpleAdmin.git
synced 2026-02-18 02:41:55 +00:00
Reworked the database layer to support both MySQL and SQLite via new provider classes and migration scripts for each backend. Updated the build workflow to support building and packaging additional modules, including StealthModule and BanSoundModule, and improved artifact handling. Refactored command registration to allow dynamic registration/unregistration and improved API event handling. Updated dependencies, project structure, and configuration checks for better reliability and extensibility. Added new language files, updated versioning, and removed obsolete files.
**⚠️ Warning: SQLite support is currently experimental.
Using this version requires reconfiguration of your database settings!
Plugin now uses UTC time. Please adjust your configurations accordingly!
**
30 lines
1.4 KiB
SQL
30 lines
1.4 KiB
SQL
CREATE TABLE IF NOT EXISTS `sa_unbans` (
|
|
`id` int(11) NOT NULL AUTO_INCREMENT,
|
|
`ban_id` int(11) NOT NULL,
|
|
`admin_id` int(11) NOT NULL DEFAULT 0,
|
|
`reason` varchar(255) NOT NULL DEFAULT 'Unknown',
|
|
`date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
PRIMARY KEY (`id`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
|
|
|
CREATE TABLE IF NOT EXISTS `sa_unmutes` (
|
|
`id` int(11) NOT NULL AUTO_INCREMENT,
|
|
`mute_id` int(11) NOT NULL,
|
|
`admin_id` int(11) NOT NULL DEFAULT 0,
|
|
`reason` varchar(255) NOT NULL DEFAULT 'Unknown',
|
|
`date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
PRIMARY KEY (`id`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
|
|
|
INSERT IGNORE INTO `sa_admins` (`id`, `player_name`, `player_steamid`, `flags`, `immunity`, `server_id`, `ends`, `created`)
|
|
VALUES (0, 'Console', 'Console', '', '0', NULL, NULL, NOW());
|
|
|
|
UPDATE `sa_admins` SET `id` = 0 WHERE `id` = -1;
|
|
|
|
ALTER TABLE `sa_bans` ADD `unban_id` INT NULL AFTER `server_id`;
|
|
ALTER TABLE `sa_mutes` ADD `unmute_id` INT NULL AFTER `server_id`;
|
|
ALTER TABLE `sa_bans` ADD FOREIGN KEY (`unban_id`) REFERENCES `sa_unbans`(`id`) ON DELETE CASCADE;
|
|
ALTER TABLE `sa_mutes` ADD FOREIGN KEY (`unmute_id`) REFERENCES `sa_unmutes`(`id`) ON DELETE CASCADE;
|
|
ALTER TABLE `sa_unbans` ADD FOREIGN KEY (`admin_id`) REFERENCES `sa_admins`(`id`) ON DELETE CASCADE;
|
|
ALTER TABLE `sa_unmutes` ADD FOREIGN KEY (`admin_id`) REFERENCES `sa_admins`(`id`) ON DELETE CASCADE;
|