CREATE TABLE IF NOT EXISTS adminbans_banned_players(id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, uuid_from CHAR(36) NOT NULL, username_from varchar(25) NOT NULL, uuid_to CHAR(36) NOT NULL, username_to varchar(25) NOT NULL, reason VARCHAR(255), until DATETIME NOT NULL, server VARCHAR(30) NOT NULL DEFAULT 'Global', created DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP)
CREATE TABLE IF NOT EXISTS adminbans_banned_ips(id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, ip varchar(15) NOT NULL, server VARCHAR(30) NOT NULL DEFAULT 'Global')
CREATE TABLE IF NOT EXISTS adminbans_muted_players(id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, uuid_from CHAR(36) NOT NULL, username_from varchar(25) NOT NULL, uuid_to CHAR(36) NOT NULL, username_to varchar(25) NOT NULL, reason VARCHAR(255), until DATETIME NOT NULL, server VARCHAR(30) NOT NULL DEFAULT 'Global', created DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP)
CREATE TABLE IF NOT EXISTS adminbans_warned_players(id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, uuid_from CHAR(36) NOT NULL, username_from varchar(25) NOT NULL, uuid_to CHAR(36) NOT NULL, username_to varchar(25) NOT NULL, reason VARCHAR(255), server VARCHAR(30) NOT NULL DEFAULT 'Global', created DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP)
CREATE TABLE IF NOT EXISTS adminbans_kicked_players(id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, uuid_from CHAR(36) NOT NULL, username_from varchar(25) NOT NULL, uuid_to CHAR(36) NOT NULL, username_to varchar(25) NOT NULL, reason VARCHAR(255), server VARCHAR(30) NOT NULL DEFAULT 'Global', created DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP)
Request for AdminBans. It's an open-source project: https://github.com/zigazajc007/AdminBans
This is how all tables look like:
And here is the API, so you can see what SQL queries are executed for specific action: https://github.com/zigazajc007/AdminBans/blob/master/src/main/java/com/rabbitcompany/adminbans/AdminBansAPI.java