mirror of
https://github.com/Unleash/unleash.git
synced 2025-05-31 01:16:01 +02:00
task: add status_code to edge traffic table to store 304s as well (#9312)
This commit is contained in:
parent
aafacc68cf
commit
edd03d02dd
@ -0,0 +1,18 @@
|
||||
exports.up = (db, cb) => {
|
||||
db.runSql(`
|
||||
ALTER TABLE stat_edge_traffic_usage ADD COLUMN status_code INT NOT NULL DEFAULT 200;
|
||||
CREATE INDEX stat_edge_traffic_usage_traffic_group_status_code_idx ON stat_edge_traffic_usage(status_code, traffic_group);
|
||||
ALTER TABLE stat_edge_traffic_usage
|
||||
DROP CONSTRAINT stat_edge_traffic_usage_pkey,
|
||||
ADD PRIMARY KEY (instance_id, traffic_group, day, status_code);
|
||||
`, cb);
|
||||
};
|
||||
|
||||
exports.down = (db, cb) => {
|
||||
db.runSql(`
|
||||
ALTER TABLE stat_edge_traffic_usage DROP CONSTRAINT stat_edge_traffic_usage_pkey;
|
||||
DROP INDEX IF EXISTS stat_edge_traffic_usage_traffic_group_status_code_idx;
|
||||
ALTER TABLE stat_edge_traffic_usage DROP COLUMN status_code;
|
||||
ALTER TABLE stat_edge_traffic_usage ADD PRIMARY KEY (instance_id, traffic_group, day);
|
||||
`, cb);
|
||||
};
|
Loading…
Reference in New Issue
Block a user