1
0
Fork 1
mirror of https://example.com synced 2024-11-23 08:56:38 +09:00
firefish/packages/backend/migration/1680375641101-clean-charts.js
ThatOneCalculator c5a0c01e4e
Revert "chore: formatting"
This reverts commit 36283b9a35.
2023-06-05 21:15:49 -07:00

25 lines
828 B
JavaScript

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;`,
);
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;`);
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;`,
);
}
}