From 03a0932c84fbec46eb37020b386e7df016691413 Mon Sep 17 00:00:00 2001 From: zkldi <20380519+zkldi@users.noreply.github.com> Date: Thu, 9 Feb 2023 01:41:58 +0000 Subject: [PATCH] fix: faulty set-indexes script --- server/package.json | 2 +- server/src/scripts/set-indexes.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/server/package.json b/server/package.json index 862a887a9..0d4da3be1 100644 --- a/server/package.json +++ b/server/package.json @@ -23,7 +23,7 @@ "make-user-admin": "ts-node src/scripts/make-user-admin.ts $@", "validate-database": "ts-node src/scripts/validate-database", "dev": "NODE_PATH=js/ nodemon", - "set-indexes": "ts-node src/scripts/set-indexes" + "set-indexes": "ts-node src/scripts/set-indexes.ts" }, "author": "zkldi", "license": "AGPL3", diff --git a/server/src/scripts/set-indexes.ts b/server/src/scripts/set-indexes.ts index fec182bd7..ab2676e77 100644 --- a/server/src/scripts/set-indexes.ts +++ b/server/src/scripts/set-indexes.ts @@ -2,7 +2,7 @@ import { SetIndexes } from "../external/mongo/indexes"; import { Command } from "commander"; import CreateLogCtx from "lib/logger/logger"; -import { ServerConfig } from "lib/setup/config"; +import { Environment, ServerConfig } from "lib/setup/config"; import { WrapScriptPromise } from "utils/misc"; const program = new Command(); @@ -19,7 +19,7 @@ program.parse(process.argv); const options: { db: string; reset?: boolean } = program.opts(); if (!options.db) { - options.db = ServerConfig.MONGO_DATABASE_NAME; + options.db = `${Environment.mongoUrl}/${ServerConfig.MONGO_DATABASE_NAME}`; } if (require.main === module) {