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:
parent
fe0c35c7f4
commit
19cb991cc9
@ -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) => ({
|
||||||
|
23
src/migrations/20220129113106-metrics-counters-as-bigint.js
Normal file
23
src/migrations/20220129113106-metrics-counters-as-bigint.js
Normal 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,
|
||||||
|
);
|
||||||
|
};
|
Loading…
Reference in New Issue
Block a user