diff --git a/svc/scenariosCleanup.js b/svc/scenariosCleanup.js index e9de64be4..69d35e812 100644 --- a/svc/scenariosCleanup.js +++ b/svc/scenariosCleanup.js @@ -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); }