feat: db tables and repo and service written
This commit is contained in:
@ -16,13 +16,28 @@ CREATE TABLE IF NOT EXISTS wifi_scan (
|
||||
lp_ttn_end_device_uplinks_id UUID,
|
||||
mac VARCHAR(255),
|
||||
rssi NUMERIC,
|
||||
latitude DOUBLE NOT NULL,
|
||||
longitude DOUBLE NOT NULL,
|
||||
created_at_utc TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at_utc TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
FOREIGN KEY (lp_ttn_end_device_uplinks_id) REFERENCES lp_ttn_end_device_uplinks(lp_ttn_end_device_uplinks_id)
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS wifi_location (
|
||||
mac VARCHAR(255) PRIMARY KEY,
|
||||
latitude DOUBLE NOT NULL,
|
||||
longitude DOUBLE NOT NULL,
|
||||
created_at_utc TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at_utc TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS wifi_location_history (
|
||||
wifi_location_history_id UUID PRIMARY KEY,
|
||||
mac VARCHAR(255),
|
||||
latitude DOUBLE NOT NULL,
|
||||
longitude DOUBLE NOT NULL,
|
||||
created_at_utc TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at_utc TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS ttn_gateway_reception (
|
||||
ttn_gateway_reception_id UUID PRIMARY KEY,
|
||||
lp_ttn_end_device_uplinks_id UUID,
|
||||
|
Reference in New Issue
Block a user