calckey/packages/backend/migration/1680375641101-clean-charts.js

18 lines
818 B
JavaScript
Raw Normal View History

2023-04-01 19:03:49 +00:00
export class CleanCharts1680375641101 {
2023-04-01 19:14:54 +00:00
constructor() {
this.name = 'CleanCharts1680375641101';
}
async up(queryRunner) {
await queryRunner.query(`delete from __chart__hashtag where ___local_users = 0 and ___remote_users = 0;`);
2023-04-01 19:03:49 +00:00
await queryRunner.query(`delete from __chart_day__hashtag where ___local_users = 0 and ___remote_users = 0;`);
2023-04-01 19:14:54 +00:00
await queryRunner.query(`COMMIT;`);
2023-04-01 19:03:49 +00:00
await queryRunner.query(`vacuum __chart__hashtag;`);
await queryRunner.query(`vacuum __chart_day__hashtag;`);
2023-04-01 19:14:54 +00:00
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;`);
}
2023-04-01 19:03:49 +00:00
}