Skip to content

Commit

Permalink
Update scenariosCleanup.js
Browse files Browse the repository at this point in the history
  • Loading branch information
howardchung authored May 31, 2022
1 parent c018d68 commit da62e37
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions svc/scenariosCleanup.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ function clearScenariosTables(cb) {
(cb) => {
db.raw('DELETE from public_matches where start_time < extract(epoch from now() - interval \'6 month\')::int').asCallback(cb);
},
(cb) => {
db.raw('delete from match_gcdata where match_id not in (select match_id from matches) and match_id < (select max(match_id) - 50000000 from match_gcdata)').asCallback(cb);
},
(cb) => {
db.raw('delete from hero_search where match_id < (select max(match_id) - 200000000 from hero_search)').asCallback(cb);
},
], cb);
}

Expand Down

0 comments on commit da62e37

Please sign in to comment.