From 8b98c9f2f4d3c6f077b6e448d30c4b566cfec0e8 Mon Sep 17 00:00:00 2001 From: Johann150 Date: Thu, 2 Feb 2023 23:24:26 +0100 Subject: [PATCH] server: remove unused 'domain' column --- packages/backend/src/models/entities/registry-item.ts | 7 ------- .../backend/src/server/api/endpoints/i/registry/get-all.ts | 1 - .../src/server/api/endpoints/i/registry/get-detail.ts | 1 - .../backend/src/server/api/endpoints/i/registry/get.ts | 1 - .../src/server/api/endpoints/i/registry/keys-with-type.ts | 1 - .../backend/src/server/api/endpoints/i/registry/keys.ts | 1 - .../backend/src/server/api/endpoints/i/registry/remove.ts | 1 - .../backend/src/server/api/endpoints/i/registry/scopes.ts | 1 - .../backend/src/server/api/endpoints/i/registry/set.ts | 2 -- 9 files changed, 16 deletions(-) diff --git a/packages/backend/src/models/entities/registry-item.ts b/packages/backend/src/models/entities/registry-item.ts index bbafae4a3..e82acb0e4 100644 --- a/packages/backend/src/models/entities/registry-item.ts +++ b/packages/backend/src/models/entities/registry-item.ts @@ -48,11 +48,4 @@ export class RegistryItem { length: 1024, array: true, default: '{}', }) public scope: string[]; - - // サードパーティアプリに開放するときのためのカラム - @Index() - @Column('varchar', { - length: 512, nullable: true, - }) - public domain: string | null; } diff --git a/packages/backend/src/server/api/endpoints/i/registry/get-all.ts b/packages/backend/src/server/api/endpoints/i/registry/get-all.ts index d92bc7af9..21fda2607 100644 --- a/packages/backend/src/server/api/endpoints/i/registry/get-all.ts +++ b/packages/backend/src/server/api/endpoints/i/registry/get-all.ts @@ -20,7 +20,6 @@ export const paramDef = { // eslint-disable-next-line import/no-default-export export default define(meta, paramDef, async (ps, user) => { const query = RegistryItems.createQueryBuilder('item') - .where('item.domain IS NULL') .andWhere('item.userId = :userId', { userId: user.id }) .andWhere('item.scope = :scope', { scope: ps.scope }); diff --git a/packages/backend/src/server/api/endpoints/i/registry/get-detail.ts b/packages/backend/src/server/api/endpoints/i/registry/get-detail.ts index 7addd0fab..2c3f7887f 100644 --- a/packages/backend/src/server/api/endpoints/i/registry/get-detail.ts +++ b/packages/backend/src/server/api/endpoints/i/registry/get-detail.ts @@ -24,7 +24,6 @@ export const paramDef = { // eslint-disable-next-line import/no-default-export export default define(meta, paramDef, async (ps, user) => { const query = RegistryItems.createQueryBuilder('item') - .where('item.domain IS NULL') .andWhere('item.userId = :userId', { userId: user.id }) .andWhere('item.key = :key', { key: ps.key }) .andWhere('item.scope = :scope', { scope: ps.scope }); diff --git a/packages/backend/src/server/api/endpoints/i/registry/get.ts b/packages/backend/src/server/api/endpoints/i/registry/get.ts index a9ca60485..02e31e626 100644 --- a/packages/backend/src/server/api/endpoints/i/registry/get.ts +++ b/packages/backend/src/server/api/endpoints/i/registry/get.ts @@ -24,7 +24,6 @@ export const paramDef = { // eslint-disable-next-line import/no-default-export export default define(meta, paramDef, async (ps, user) => { const query = RegistryItems.createQueryBuilder('item') - .where('item.domain IS NULL') .andWhere('item.userId = :userId', { userId: user.id }) .andWhere('item.key = :key', { key: ps.key }) .andWhere('item.scope = :scope', { scope: ps.scope }); diff --git a/packages/backend/src/server/api/endpoints/i/registry/keys-with-type.ts b/packages/backend/src/server/api/endpoints/i/registry/keys-with-type.ts index d9982b036..e865ce1db 100644 --- a/packages/backend/src/server/api/endpoints/i/registry/keys-with-type.ts +++ b/packages/backend/src/server/api/endpoints/i/registry/keys-with-type.ts @@ -20,7 +20,6 @@ export const paramDef = { // eslint-disable-next-line import/no-default-export export default define(meta, paramDef, async (ps, user) => { const query = RegistryItems.createQueryBuilder('item') - .where('item.domain IS NULL') .andWhere('item.userId = :userId', { userId: user.id }) .andWhere('item.scope = :scope', { scope: ps.scope }); diff --git a/packages/backend/src/server/api/endpoints/i/registry/keys.ts b/packages/backend/src/server/api/endpoints/i/registry/keys.ts index b625f50ca..3072805bc 100644 --- a/packages/backend/src/server/api/endpoints/i/registry/keys.ts +++ b/packages/backend/src/server/api/endpoints/i/registry/keys.ts @@ -21,7 +21,6 @@ export const paramDef = { export default define(meta, paramDef, async (ps, user) => { const query = RegistryItems.createQueryBuilder('item') .select('item.key') - .where('item.domain IS NULL') .andWhere('item.userId = :userId', { userId: user.id }) .andWhere('item.scope = :scope', { scope: ps.scope }); diff --git a/packages/backend/src/server/api/endpoints/i/registry/remove.ts b/packages/backend/src/server/api/endpoints/i/registry/remove.ts index f656f3d83..b75fbaff6 100644 --- a/packages/backend/src/server/api/endpoints/i/registry/remove.ts +++ b/packages/backend/src/server/api/endpoints/i/registry/remove.ts @@ -24,7 +24,6 @@ export const paramDef = { // eslint-disable-next-line import/no-default-export export default define(meta, paramDef, async (ps, user) => { const query = RegistryItems.createQueryBuilder('item') - .where('item.domain IS NULL') .andWhere('item.userId = :userId', { userId: user.id }) .andWhere('item.key = :key', { key: ps.key }) .andWhere('item.scope = :scope', { scope: ps.scope }); diff --git a/packages/backend/src/server/api/endpoints/i/registry/scopes.ts b/packages/backend/src/server/api/endpoints/i/registry/scopes.ts index d946fe609..9b0f43d33 100644 --- a/packages/backend/src/server/api/endpoints/i/registry/scopes.ts +++ b/packages/backend/src/server/api/endpoints/i/registry/scopes.ts @@ -17,7 +17,6 @@ export const paramDef = { export default define(meta, paramDef, async (ps, user) => { const query = RegistryItems.createQueryBuilder('item') .select('item.scope') - .where('item.domain IS NULL') .andWhere('item.userId = :userId', { userId: user.id }); const items = await query.getMany(); diff --git a/packages/backend/src/server/api/endpoints/i/registry/set.ts b/packages/backend/src/server/api/endpoints/i/registry/set.ts index 03d81d8c4..98eab9b35 100644 --- a/packages/backend/src/server/api/endpoints/i/registry/set.ts +++ b/packages/backend/src/server/api/endpoints/i/registry/set.ts @@ -24,7 +24,6 @@ export const paramDef = { // eslint-disable-next-line import/no-default-export export default define(meta, paramDef, async (ps, user) => { const query = RegistryItems.createQueryBuilder('item') - .where('item.domain IS NULL') .andWhere('item.userId = :userId', { userId: user.id }) .andWhere('item.key = :key', { key: ps.key }) .andWhere('item.scope = :scope', { scope: ps.scope }); @@ -42,7 +41,6 @@ export default define(meta, paramDef, async (ps, user) => { createdAt: new Date(), updatedAt: new Date(), userId: user.id, - domain: null, scope: ps.scope, key: ps.key, value: ps.value,