diff --git a/server/sql/tables.sql b/server/sql/tables.sql index babf48b..5788884 100644 --- a/server/sql/tables.sql +++ b/server/sql/tables.sql @@ -46,6 +46,8 @@ CREATE TABLE IF NOT EXISTS location ( wifi_longitude DOUBLE, gnss_latitude DOUBLE, gnss_longitude DOUBLE, + ttn_gw_latitude DOUBLE, + ttn_gw_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) diff --git a/server/src/models/location.ts b/server/src/models/location.ts index 1a79938..63668b5 100644 --- a/server/src/models/location.ts +++ b/server/src/models/location.ts @@ -8,6 +8,8 @@ export class Location extends Model { public wifi_longitude!: number; public gnss_latitude!: number; public gnss_longitude!: number; + public ttn_gw_latitude!: number; + public ttn_gw_longitude!: number; public created_at_utc!: Date; public updated_at_utc!: Date; } @@ -40,6 +42,14 @@ Location.init( type: DataTypes.NUMBER, allowNull: true, }, + ttn_gw_latitude: { + type: DataTypes.NUMBER, + allowNull: true, + }, + ttn_gw__longitude: { + type: DataTypes.NUMBER, + allowNull: true, + }, created_at_utc: { type: DataTypes.DATE, defaultValue: DataTypes.NOW,