mirror of
https://github.com/zkldi/Tachi.git
synced 2026-09-29 02:18:09 +03:00
fix: separate some migrations to boku/kamai specific
since some migrations are boku/kamai specific, them running on the wrong thing causes unecessary stress and gray hairs for me
This commit is contained in:
@@ -5,7 +5,7 @@ import RemoveMultifolderStats from "./migrations/remove-multifolder-stats";
|
||||
import UpdateJubeatPreferredTables from "./migrations/update-jubeat-preferred-tables";
|
||||
import db from "external/mongo/db";
|
||||
import CreateLogCtx from "lib/logger/logger";
|
||||
import { Environment } from "lib/setup/config";
|
||||
import { Environment, TachiConfig } from "lib/setup/config";
|
||||
import type { Migration } from "utils/types";
|
||||
|
||||
const logger = CreateLogCtx(__filename);
|
||||
@@ -27,13 +27,25 @@ export const FAKE_MIGRATION: Migration = {
|
||||
const REGISTERED_MIGRATIONS: Array<Migration> =
|
||||
Environment.nodeEnv === "test"
|
||||
? [FAKE_MIGRATION]
|
||||
: [
|
||||
UGPTRivalsMigration,
|
||||
RemoveMultifolderStats,
|
||||
RemoveIIDXBeginners,
|
||||
UpdateJubeatPreferredTables,
|
||||
RecalcBrokenIIDXNotecounts,
|
||||
];
|
||||
: [UGPTRivalsMigration, RemoveMultifolderStats];
|
||||
|
||||
// only apply type-specific migrations if we're not in testing
|
||||
if (Environment.nodeEnv !== "test") {
|
||||
// kamaitachi specific migrations
|
||||
if (TachiConfig.TYPE !== "btchi") {
|
||||
// these only make sense if iidx is supported.
|
||||
REGISTERED_MIGRATIONS.push(
|
||||
RecalcBrokenIIDXNotecounts,
|
||||
RemoveIIDXBeginners,
|
||||
UpdateJubeatPreferredTables
|
||||
);
|
||||
}
|
||||
|
||||
// bokutachi specific migrations
|
||||
if (TachiConfig.TYPE !== "ktchi") {
|
||||
// none, currently
|
||||
}
|
||||
}
|
||||
|
||||
function CreateMigrationLookupMap(migrations: Array<Migration>) {
|
||||
const map = new Map<string, Migration>();
|
||||
|
||||
Reference in New Issue
Block a user