feat: added location to wifiscan table
This commit is contained in:
parent
8b8c6aef2a
commit
9ef53f4116
@ -26,6 +26,8 @@ CREATE TABLE IF NOT EXISTS wifi_scan (
|
|||||||
lp_ttn_end_device_uplinks_id UUID,
|
lp_ttn_end_device_uplinks_id UUID,
|
||||||
mac VARCHAR(255),
|
mac VARCHAR(255),
|
||||||
rssi NUMERIC,
|
rssi NUMERIC,
|
||||||
|
latitude DOUBLE,
|
||||||
|
longitude DOUBLE,
|
||||||
created_at_utc TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
created_at_utc TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||||
updated_at_utc TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE 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)
|
FOREIGN KEY (lp_ttn_end_device_uplinks_id) REFERENCES lp_ttn_end_device_uplinks(lp_ttn_end_device_uplinks_id)
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import dotenv from "dotenv";
|
import dotenv from "dotenv";
|
||||||
|
|
||||||
dotenv.config();
|
dotenv.config();
|
||||||
console.log(process.env.NODE_ENV);
|
|
||||||
export const config = {
|
export const config = {
|
||||||
username: process.env.DB_USER!,
|
username: process.env.DB_USER!,
|
||||||
password: process.env.DB_PASSWORD!,
|
password: process.env.DB_PASSWORD!,
|
||||||
|
@ -2,10 +2,12 @@ import { DataTypes, Model } from "sequelize";
|
|||||||
import { sequelize } from "../database/database";
|
import { sequelize } from "../database/database";
|
||||||
|
|
||||||
export class WifiScan extends Model {
|
export class WifiScan extends Model {
|
||||||
public wifi_scan_id!: string;
|
|
||||||
public lp_ttn_end_device_uplinks_id!: string;
|
public lp_ttn_end_device_uplinks_id!: string;
|
||||||
|
public wifi_scan_id!: string;
|
||||||
public mac!: string;
|
public mac!: string;
|
||||||
public rssi!: number;
|
public rssi!: number;
|
||||||
|
public latitude!: number;
|
||||||
|
public longitude!: number;
|
||||||
public created_at_utc!: Date;
|
public created_at_utc!: Date;
|
||||||
public updated_at_utc!: Date;
|
public updated_at_utc!: Date;
|
||||||
}
|
}
|
||||||
@ -30,6 +32,14 @@ WifiScan.init(
|
|||||||
type: DataTypes.NUMBER,
|
type: DataTypes.NUMBER,
|
||||||
allowNull: true,
|
allowNull: true,
|
||||||
},
|
},
|
||||||
|
latitude: {
|
||||||
|
type: DataTypes.NUMBER,
|
||||||
|
allowNull: true,
|
||||||
|
},
|
||||||
|
longitude: {
|
||||||
|
type: DataTypes.NUMBER,
|
||||||
|
allowNull: true,
|
||||||
|
},
|
||||||
created_at_utc: {
|
created_at_utc: {
|
||||||
type: DataTypes.DATE,
|
type: DataTypes.DATE,
|
||||||
defaultValue: DataTypes.NOW,
|
defaultValue: DataTypes.NOW,
|
||||||
|
Loading…
Reference in New Issue
Block a user