Skip to content

Commit

Permalink
ChartRangeUpscale (#417)
Browse files Browse the repository at this point in the history
  • Loading branch information
kozakura913 authored Sep 5, 2024
1 parent 3d6f2e5 commit f8c1f87
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG_YOJO.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
-

### Server
-
- Change: 溢れそうなチャートの型を大きいものに変更

### Misc

Expand Down
30 changes: 30 additions & 0 deletions packages/backend/migration/1725547203459-ChartRangeUpscale.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* SPDX-FileCopyrightText: syuilo and misskey-project, yojo-art team
* SPDX-License-Identifier: AGPL-3.0-only
*/

export class ChartRangeUpscale1725547203459 {
name = 'ChartRangeUpscale1725547203459'

async up(queryRunner) {
await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___requests_failed" TYPE integer`);
await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___requests_succeeded" TYPE integer`);
await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___requests_received" TYPE integer`);
await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___notes_total" TYPE bigint`);
await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___requests_failed" TYPE integer`);
await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___requests_succeeded" TYPE integer`);
await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___requests_received" TYPE integer`);
await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___notes_total" TYPE bigint`);
}

async down(queryRunner) {
await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___requests_failed" TYPE smallint`);
await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___requests_succeeded" TYPE smallint`);
await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___requests_received" TYPE smallint`);
await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___notes_total" TYPE integer`);
await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___requests_failed" TYPE smallint`);
await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___requests_succeeded" TYPE smallint`);
await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___requests_received" TYPE smallint`);
await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___notes_total" TYPE integer`);
}
}
8 changes: 4 additions & 4 deletions packages/backend/src/core/chart/charts/entities/instance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import Chart from '../../core.js';
export const name = 'instance';

export const schema = {
'requests.failed': { range: 'small' },
'requests.succeeded': { range: 'small' },
'requests.received': { range: 'small' },
'notes.total': { accumulate: true },
'requests.failed': { range: 'medium' },
'requests.succeeded': { range: 'medium' },
'requests.received': { range: 'medium' },
'notes.total': { range: 'big', accumulate: true },
'notes.inc': {},
'notes.dec': {},
'notes.diffs.normal': {},
Expand Down

0 comments on commit f8c1f87

Please sign in to comment.