From 7522cdf445e423604d53b7234e6242e2aec25274 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Sat, 1 Apr 2023 12:14:54 -0700 Subject: [PATCH] fix migration --- .../migration/1680375641101-clean-charts.js | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/packages/backend/migration/1680375641101-clean-charts.js b/packages/backend/migration/1680375641101-clean-charts.js index 3fec0fef2..c125f43a3 100644 --- a/packages/backend/migration/1680375641101-clean-charts.js +++ b/packages/backend/migration/1680375641101-clean-charts.js @@ -1,15 +1,17 @@ export class CleanCharts1680375641101 { - constructor() { - this.name = 'CleanCharts1680375641101'; - } - async up(queryRunner) { - await queryRunner.query(`delete from __chart__hashtag where ___local_users = 0 and ___remote_users = 0;`); + constructor() { + this.name = 'CleanCharts1680375641101'; + } + async up(queryRunner) { + await queryRunner.query(`delete from __chart__hashtag where ___local_users = 0 and ___remote_users = 0;`); await queryRunner.query(`delete from __chart_day__hashtag where ___local_users = 0 and ___remote_users = 0;`); + await queryRunner.query(`COMMIT;`); await queryRunner.query(`vacuum __chart__hashtag;`); await queryRunner.query(`vacuum __chart_day__hashtag;`); - } - async down(queryRunner) { - await queryRunner.query(`vacuum __chart__hashtag;`); - await queryRunner.query(`vacuum __chart_day__hashtag;`); - } + await queryRunner.query(`COMMIT;`); + } + async down(queryRunner) { + await queryRunner.query(`delete from __chart__hashtag where ___local_users = 0 and ___remote_users = 0;`); + await queryRunner.query(`delete from __chart_day__hashtag where ___local_users = 0 and ___remote_users = 0;`); + } }