updated db create script and updated mysql queries

This commit is contained in:
jenz
2023-02-07 20:45:15 +01:00
parent a8fac665c9
commit 0a9c1f1394
2 changed files with 40 additions and 14 deletions
+13 -5
View File
@@ -1,13 +1,21 @@
CREATE TABLE `ban_detector` (
`fingerprint` varchar(512) NOT NULL,
`ip` varchar(64) NOT NULL,
`steamid` varchar(64) DEFAULT NULL,
`name` varchar(128) DEFAULT NULL,
`created_on` datetime DEFAULT CURRENT_TIMESTAMP
PRIMARY KEY (`fingerprint`,`ip`)
);
`created_on` datetime DEFAULT CURRENT_TIMESTAMP,
`ID` int AUTO_INCREMENT,
PRIMARY KEY (`fingerprint`,`ip`),
KEY `ID` (`ID`)
)
CREATE TABLE `ban_detector_steamids` (
`steamid` varchar(64) DEFAULT NULL,
`name` varchar(128) DEFAULT NULL,
`ID` int NOT NULL,
FOREIGN KEY (`ID`) REFERENCES ban_detector(ID)
ON DELETE CASCADE
)
--usefull read query
select bd2.* from ban_detector bd2
inner join