-
Notifications
You must be signed in to change notification settings - Fork 0
/
stats.sql
22 lines (19 loc) · 836 Bytes
/
stats.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
CREATE TABLE `stats_visits` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`ip` varchar(15) DEFAULT NULL,
`appid` int(11) unsigned DEFAULT NULL,
`language` varchar(255) DEFAULT NULL,
`filters` text,
`date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
KEY `ip` (`ip`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1;
CREATE TABLE `stats_users` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`fk_stats_visits_id` int(11) unsigned NOT NULL,
`steamid` bigint(11) unsigned DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `fk_stats_visits_id` (`fk_stats_visits_id`),
KEY `steamid` (`steamid`),
CONSTRAINT `fk_stats_visits_id` FOREIGN KEY (`fk_stats_visits_id`) REFERENCES `stats_visits` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1;