From 21fc3df1608ec844a5519dd7256449af798f7ae6 Mon Sep 17 00:00:00 2001 From: kozakura913 <98575220+kozakura913@users.noreply.github.com> Date: Fri, 6 Sep 2024 00:20:12 +0900 Subject: [PATCH 1/3] ChartRangeUpscale --- .../1725547203459-ChartRangeUpscale.js | 22 +++++++++++++++++++ .../core/chart/charts/entities/instance.ts | 8 +++---- 2 files changed, 26 insertions(+), 4 deletions(-) create mode 100644 packages/backend/migration/1725547203459-ChartRangeUpscale.js diff --git a/packages/backend/migration/1725547203459-ChartRangeUpscale.js b/packages/backend/migration/1725547203459-ChartRangeUpscale.js new file mode 100644 index 0000000000..73fccb28fc --- /dev/null +++ b/packages/backend/migration/1725547203459-ChartRangeUpscale.js @@ -0,0 +1,22 @@ +/* + * 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`); + } + + 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`); + } +} diff --git a/packages/backend/src/core/chart/charts/entities/instance.ts b/packages/backend/src/core/chart/charts/entities/instance.ts index d0cac3e73f..2f31d76e40 100644 --- a/packages/backend/src/core/chart/charts/entities/instance.ts +++ b/packages/backend/src/core/chart/charts/entities/instance.ts @@ -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': {}, From c4dd628ca616eee421c987a26d027f4dc17239d9 Mon Sep 17 00:00:00 2001 From: kozakura913 <98575220+kozakura913@users.noreply.github.com> Date: Fri, 6 Sep 2024 00:41:32 +0900 Subject: [PATCH 2/3] day --- .../backend/migration/1725547203459-ChartRangeUpscale.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/backend/migration/1725547203459-ChartRangeUpscale.js b/packages/backend/migration/1725547203459-ChartRangeUpscale.js index 73fccb28fc..0e780cc4f5 100644 --- a/packages/backend/migration/1725547203459-ChartRangeUpscale.js +++ b/packages/backend/migration/1725547203459-ChartRangeUpscale.js @@ -11,6 +11,10 @@ export class ChartRangeUpscale1725547203459 { 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) { @@ -18,5 +22,9 @@ export class ChartRangeUpscale1725547203459 { 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`); } } From 3778a6cee8cfa06366bd52bab3ce18cae8de87ce Mon Sep 17 00:00:00 2001 From: kozakura913 <98575220+kozakura913@users.noreply.github.com> Date: Fri, 6 Sep 2024 01:03:44 +0900 Subject: [PATCH 3/3] Update CHANGELOG_YOJO.md --- CHANGELOG_YOJO.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG_YOJO.md b/CHANGELOG_YOJO.md index cf39167743..5efa682e90 100644 --- a/CHANGELOG_YOJO.md +++ b/CHANGELOG_YOJO.md @@ -9,7 +9,7 @@ - ### Server -- +- Change: 溢れそうなチャートの型を大きいものに変更 ### Misc