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