From 1274af05a417bbf0cf09fdebcbfc988b27d2584f Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 12 Mar 2023 16:28:07 +0100 Subject: [PATCH] remove unused instance settings --- packages/backend/1678427401214-remove-unused.js | 13 +++++++++++++ packages/backend/src/models/entities/meta.ts | 11 ----------- .../backend/src/server/api/endpoints/admin/meta.ts | 2 -- .../src/server/api/endpoints/admin/update-meta.ts | 12 ------------ packages/backend/src/server/api/endpoints/meta.ts | 2 -- 5 files changed, 13 insertions(+), 27 deletions(-) create mode 100644 packages/backend/1678427401214-remove-unused.js diff --git a/packages/backend/1678427401214-remove-unused.js b/packages/backend/1678427401214-remove-unused.js new file mode 100644 index 000000000..7bdc0581d --- /dev/null +++ b/packages/backend/1678427401214-remove-unused.js @@ -0,0 +1,13 @@ +export class removeUnused1678427401214 { + name = 'removeUnused1678427401214' + + async up(queryRunner) { + await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "pinnedPages"`); + await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "pinnedClipId"`); + } + + async down(queryRunner) { + await queryRunner.query(`ALTER TABLE "meta" ADD "pinnedClipId" character varying(32)`); + await queryRunner.query(`ALTER TABLE "meta" ADD "pinnedPages" character varying(512) array NOT NULL DEFAULT '{/featured,/channels,/explore,/pages,/about-misskey}'`); + } +} diff --git a/packages/backend/src/models/entities/meta.ts b/packages/backend/src/models/entities/meta.ts index 9c438bcd6..28ba51195 100644 --- a/packages/backend/src/models/entities/meta.ts +++ b/packages/backend/src/models/entities/meta.ts @@ -82,17 +82,6 @@ export class Meta { }) public blockedHosts: string[]; - @Column('varchar', { - length: 512, array: true, default: '{/featured,/channels,/explore,/pages,/about-foundkey}', - }) - public pinnedPages: string[]; - - @Column({ - ...id(), - nullable: true, - }) - public pinnedClipId: Clip['id'] | null; - @Column('varchar', { length: 512, nullable: true, diff --git a/packages/backend/src/server/api/endpoints/admin/meta.ts b/packages/backend/src/server/api/endpoints/admin/meta.ts index 175e90206..79f598014 100644 --- a/packages/backend/src/server/api/endpoints/admin/meta.ts +++ b/packages/backend/src/server/api/endpoints/admin/meta.ts @@ -288,8 +288,6 @@ export default define(meta, paramDef, async () => { defaultLightTheme: instance.defaultLightTheme, defaultDarkTheme: instance.defaultDarkTheme, enableEmail: instance.enableEmail, - pinnedPages: instance.pinnedPages, - pinnedClipId: instance.pinnedClipId, cacheRemoteFiles: instance.cacheRemoteFiles, useStarForReactionFallback: instance.useStarForReactionFallback, diff --git a/packages/backend/src/server/api/endpoints/admin/update-meta.ts b/packages/backend/src/server/api/endpoints/admin/update-meta.ts index d3637aafc..984aa2a9d 100644 --- a/packages/backend/src/server/api/endpoints/admin/update-meta.ts +++ b/packages/backend/src/server/api/endpoints/admin/update-meta.ts @@ -48,10 +48,6 @@ export const paramDef = { proxyAccountId: { type: 'string', format: 'misskey:id', nullable: true }, maintainerName: { type: 'string', nullable: true }, maintainerEmail: { type: 'string', nullable: true }, - pinnedPages: { type: 'array', items: { - type: 'string', - } }, - pinnedClipId: { type: 'string', format: 'misskey:id', nullable: true }, langs: { type: 'array', items: { type: 'string', } }, @@ -209,14 +205,6 @@ export default define(meta, paramDef, async (ps, me) => { set.langs = ps.langs.filter(Boolean); } - if (Array.isArray(ps.pinnedPages)) { - set.pinnedPages = ps.pinnedPages.filter(Boolean); - } - - if (ps.pinnedClipId !== undefined) { - set.pinnedClipId = ps.pinnedClipId; - } - if (ps.summalyProxy !== undefined) { set.summalyProxy = ps.summalyProxy; } diff --git a/packages/backend/src/server/api/endpoints/meta.ts b/packages/backend/src/server/api/endpoints/meta.ts index 2a05602f5..35c8839b4 100644 --- a/packages/backend/src/server/api/endpoints/meta.ts +++ b/packages/backend/src/server/api/endpoints/meta.ts @@ -305,8 +305,6 @@ export default define(meta, paramDef, async () => { translatorAvailable: translatorAvailable(instance), - pinnedPages: instance.pinnedPages, - pinnedClipId: instance.pinnedClipId, cacheRemoteFiles: instance.cacheRemoteFiles, requireSetup: (await Users.countBy({ host: IsNull(),