1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-04-24 01:18:01 +02:00

fix: metric counters should use bigint (#1313)

This commit is contained in:
Ivar Conradi Østhus 2022-01-31 08:50:11 +01:00 committed by GitHub
parent fe0c35c7f4
commit 19cb991cc9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 2 deletions

View File

@ -24,8 +24,8 @@ const fromRow = (row: ClientMetricsEnvTable) => ({
appName: row.app_name, appName: row.app_name,
environment: row.environment, environment: row.environment,
timestamp: row.timestamp, timestamp: row.timestamp,
yes: row.yes, yes: Number(row.yes),
no: row.no, no: Number(row.no),
}); });
const toRow = (metric: IClientMetricsEnv) => ({ const toRow = (metric: IClientMetricsEnv) => ({

View File

@ -0,0 +1,23 @@
'use strict';
exports.up = function (db, cb) {
db.runSql(
`
ALTER TABLE client_metrics_env
ALTER COLUMN yes TYPE BIGINT,
ALTER COLUMN no TYPE BIGINT;
`,
cb,
);
};
exports.down = function (db, cb) {
db.runSql(
`
ALTER TABLE client_metrics_env
ALTER COLUMN yes TYPE INTEGER,
ALTER COLUMN no TYPE INTEGER;
`,
cb,
);
};