wifi-probe-aggregator/ws/setup.sql

22 lines
591 B
MySQL
Raw Normal View History

2020-06-27 17:30:23 +02:00
--
-- Creazione tabella per il salvataggio dei mac address
--
CREATE TABLE `logs` (
2020-07-25 10:57:57 +02:00
`id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
2020-06-27 17:30:23 +02:00
`mac` varchar(17) NOT NULL,
`ssid` varchar(255) NOT NULL,
`dbm` tinyint(4) NOT NULL,
`latitude` decimal(9,6) NOT NULL,
`longitude` decimal(9,6) NOT NULL,
`received_at` datetime NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB;
-- Tabella per il match fra mac address e nome
CREATE TABLE `devices` (
`id` INT NOT NULL AUTO_INCREMENT,
`nome` VARCHAR(255) NOT NULL,
`mac` VARCHAR(17) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE = InnoDB;