From f3c5edc852bf6d8c00a8fb500de44e888cad47a9 Mon Sep 17 00:00:00 2001 From: Masaya Suzuki <15100604+massongit@users.noreply.github.com> Date: Tue, 7 Feb 2023 19:50:38 +0900 Subject: [PATCH] fix: postgre -> postgres (#9814) --- packages/backend/ormconfig.js | 2 +- packages/backend/src/GlobalModule.ts | 4 ++-- packages/backend/src/{postgre.ts => postgres.ts} | 2 +- packages/backend/test/utils.ts | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) rename packages/backend/src/{postgre.ts => postgres.ts} (99%) diff --git a/packages/backend/ormconfig.js b/packages/backend/ormconfig.js index 32c26f7b6..229e5bf1f 100644 --- a/packages/backend/ormconfig.js +++ b/packages/backend/ormconfig.js @@ -1,6 +1,6 @@ import { DataSource } from 'typeorm'; import { loadConfig } from './built/config.js'; -import { entities } from './built/postgre.js'; +import { entities } from './built/postgres.js'; const config = loadConfig(); diff --git a/packages/backend/src/GlobalModule.ts b/packages/backend/src/GlobalModule.ts index 8a70129eb..35416209a 100644 --- a/packages/backend/src/GlobalModule.ts +++ b/packages/backend/src/GlobalModule.ts @@ -4,7 +4,7 @@ import { DataSource } from 'typeorm'; import { createRedisConnection } from '@/redis.js'; import { DI } from './di-symbols.js'; import { loadConfig } from './config.js'; -import { createPostgreDataSource } from './postgre.js'; +import { createPostgresDataSource } from './postgres.js'; import { RepositoryModule } from './models/RepositoryModule.js'; import type { Provider, OnApplicationShutdown } from '@nestjs/common'; @@ -18,7 +18,7 @@ const $config: Provider = { const $db: Provider = { provide: DI.db, useFactory: async (config) => { - const db = createPostgreDataSource(config); + const db = createPostgresDataSource(config); return await db.initialize(); }, inject: [DI.config], diff --git a/packages/backend/src/postgre.ts b/packages/backend/src/postgres.ts similarity index 99% rename from packages/backend/src/postgre.ts rename to packages/backend/src/postgres.ts index c55cb78a6..33b924e77 100644 --- a/packages/backend/src/postgre.ts +++ b/packages/backend/src/postgres.ts @@ -197,7 +197,7 @@ export const entities = [ const log = process.env.NODE_ENV !== 'production'; -export function createPostgreDataSource(config: Config) { +export function createPostgresDataSource(config: Config) { return new DataSource({ type: 'postgres', host: config.db.host, diff --git a/packages/backend/test/utils.ts b/packages/backend/test/utils.ts index c8fd41e1d..50988939a 100644 --- a/packages/backend/test/utils.ts +++ b/packages/backend/test/utils.ts @@ -11,7 +11,7 @@ import FormData from 'form-data'; import { DataSource } from 'typeorm'; import got, { RequestError } from 'got'; import loadConfig from '../src/config/load.js'; -import { entities } from '../src/postgre.js'; +import { entities } from '@/postgres.js'; import type * as misskey from 'misskey-js'; const _filename = fileURLToPath(import.meta.url);