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;
|
2020-07-27 21:55:26 +02:00
|
|
|
|
|
|
|
-- 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;
|