Skip to content

Commit

Permalink
chore: add indexes for traffic_group and status_code_series to migration
Browse files Browse the repository at this point in the history
  • Loading branch information
daveleek committed Feb 8, 2024
1 parent 789c819 commit cc2191f
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ exports.up = (db, callback) => {
count BIGINT NOT NULL DEFAULT 0,
PRIMARY KEY(day, traffic_group, status_code_series)
);
CREATE INDEX IF NOT EXISTS stat_traffic_usage_traffic_group_idx ON stat_traffic_usage (traffic_group);
CREATE INDEX IF NOT EXISTS stat_traffic_usage_status_code_series_idx ON stat_traffic_usage (status_code_series);
`,
callback,
);
Expand All @@ -17,6 +19,8 @@ exports.up = (db, callback) => {
exports.down = (db, callback) => {
db.runSql(
`
DROP INDEX IF EXISTS stat_traffic_usage_traffic_group_idx;
DROP INDEX IF EXISTS stat_traffic_usage_status_code_series_idx;
DROP TABLE IF EXISTS stat_traffic_usage;
`,
callback,
Expand Down

0 comments on commit cc2191f

Please sign in to comment.