Skip to content

Commit

Permalink
task: make count column bigint. (#8183)
Browse files Browse the repository at this point in the history
We now have customers that exceed INT capacity, so we need to change
this to BIGINT in client_metrics_env_variants_daily as well.

Even heavy users only have about 10000 rows here, so should be a quick
enough operation.
  • Loading branch information
chriswk committed Sep 19, 2024
1 parent 15a98fc commit 29b292f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ const variantRowReducerV2 = (acc, tokenRow) => {
};
}
if (variant) {
acc[key].variants[variant] = count;
acc[key].variants[variant] = Number(count);
}

return acc;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
exports.up = function(db, cb) {
db.runSql(`ALTER TABLE client_metrics_env_variants_daily ALTER COLUMN count TYPE BIGINT`, cb);
};

exports.down = function(db, cb) {
db.runSql(`ALTER TABLE client_metrics_env_variants_daily ALTER COLUMN count TYPE INT`, cb);
};

0 comments on commit 29b292f

Please sign in to comment.