mirror of
https://example.com
synced 2024-11-23 21:16:39 +09:00
chore: add cleanup migration
This commit is contained in:
parent
8cc7d11fa4
commit
33ae0ca6fd
1 changed files with 15 additions and 0 deletions
15
packages/backend/migration/1680375641101-clean-charts.js
Normal file
15
packages/backend/migration/1680375641101-clean-charts.js
Normal file
|
@ -0,0 +1,15 @@
|
|||
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(`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;`);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue