Bugfix
This commit is contained in:
@@ -8,6 +8,7 @@ import updateTable from "./utils/updateTable";
|
||||
import dbHandler from "./utils/dbHandler";
|
||||
import EJSON from "../utils/ejson";
|
||||
import { DSQL_DatabaseSchemaType } from "../types";
|
||||
import grabDirNames from "@/utils/backend/names/grab-dir-names";
|
||||
|
||||
type Param = {
|
||||
userId?: number | string | null;
|
||||
@@ -24,12 +25,11 @@ export default async function createDbFromSchema({
|
||||
targetDatabase,
|
||||
dbSchemaData,
|
||||
}: Param) {
|
||||
const schemaPath = userId
|
||||
? path.join(
|
||||
String(process.env.DSQL_USER_DB_SCHEMA_PATH),
|
||||
`/user-${userId}/main.json`
|
||||
)
|
||||
: path.resolve(__dirname, "../../jsonData/dbSchemas/main.json");
|
||||
const { userSchemaMainJSONFilePath, mainShemaJSONFilePath } = grabDirNames({
|
||||
userId,
|
||||
});
|
||||
|
||||
const schemaPath = userSchemaMainJSONFilePath || mainShemaJSONFilePath;
|
||||
|
||||
const dbSchema: DSQL_DatabaseSchemaType[] | undefined =
|
||||
dbSchemaData ||
|
||||
|
||||
Reference in New Issue
Block a user