diff --git a/prisma/migrations/20231127154808_add_telemetry_session_ip/migration.sql b/prisma/migrations/20231127154808_add_telemetry_session_ip/migration.sql new file mode 100644 index 00000000..86ca4de2 --- /dev/null +++ b/prisma/migrations/20231127154808_add_telemetry_session_ip/migration.sql @@ -0,0 +1,2 @@ +-- AlterTable +ALTER TABLE "TelemetrySession" ADD COLUMN "ip" VARCHAR(45); diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 94e26f76..7819e161 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -187,6 +187,7 @@ model TelemetrySession { hostname String? @db.VarChar(100) browser String? @db.VarChar(20) os String? @db.VarChar(20) + ip String? @db.VarChar(45) country String? @db.Char(2) subdivision1 String? @db.VarChar(20) subdivision2 String? @db.VarChar(50) diff --git a/src/server/model/telemetry.ts b/src/server/model/telemetry.ts index b59560db..e65fdadb 100644 --- a/src/server/model/telemetry.ts +++ b/src/server/model/telemetry.ts @@ -94,6 +94,7 @@ async function findSession(req: Request, url: string) { hostname, browser, os, + ip, country, subdivision1, subdivision2,