Bug Fixes
This commit is contained in:
@@ -173,7 +173,7 @@ const { URL } = __webpack_require__(7310);
|
||||
var __webpack_require__ = require("../../../webpack-api-runtime.js");
|
||||
__webpack_require__.C(exports);
|
||||
var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId))
|
||||
var __webpack_exports__ = __webpack_require__.X(0, [5425,2224,2163,6825,3017,3403,7547,5886], () => (__webpack_exec__(7131)));
|
||||
var __webpack_exports__ = __webpack_require__.X(0, [2224,2163,6825,3017,3403,7547,5886], () => (__webpack_exec__(7131)));
|
||||
module.exports = __webpack_exports__;
|
||||
|
||||
})();
|
||||
File diff suppressed because one or more lines are too long
@@ -97,11 +97,11 @@ const path = __webpack_require__(1017);
|
||||
* @async
|
||||
* @param {object} params
|
||||
* @param {number | string} params.userId
|
||||
* @param {DSQL_DatabaseSchemaType[]} params.dbSchema
|
||||
* @param {import("@/package-shared/types").DSQL_DatabaseSchemaType[]} params.dbSchema
|
||||
* @param {string} [params.targetDb] - Eg `datasquirel_user_7_db_name`
|
||||
* @returns {string}
|
||||
*/ const dbSchemaExec = ({ userId , dbSchema , targetDb })=>{
|
||||
const userSchemaPath = path.resolve(process.cwd(), "jsonData/dbSchemas/users", `user-${userId}`, "main.json");
|
||||
const userSchemaPath = path.resolve(String(process.env.DSQL_USER_DB_SCHEMA_PATH), `user-${userId}`, "main.json");
|
||||
fs.writeFileSync(userSchemaPath, JSON.stringify(dbSchema), "utf-8");
|
||||
const targetPath = path.join(process.cwd(), "shell");
|
||||
const dbShellUpdate = execSync(`node createDbFromSchema.js --user ${userId}${targetDb ? " --database " + targetDb : ""}`, {
|
||||
@@ -113,12 +113,12 @@ const path = __webpack_require__(1017);
|
||||
* @async
|
||||
* @param {object} params
|
||||
* @param {number | string} params.userId
|
||||
* @param {DSQL_DatabaseSchemaType} params.dbSchema - New Db Schema for `targetDbFullName` variable
|
||||
* @param {DSQL_MYSQL_user_databases_Type} params.database - Db entry
|
||||
* @param {import("@/package-shared/types").DSQL_DatabaseSchemaType} params.dbSchema - New Db Schema for `targetDbFullName` variable
|
||||
* @param {import("@/package-shared/types").DSQL_MYSQL_user_databases_Type} params.database - Db entry
|
||||
* @returns {string}
|
||||
*/ const dbSchemaExecDbUpdate = ({ userId , dbSchema , database })=>{
|
||||
const userSchemaPath = path.resolve(process.cwd(), "jsonData/dbSchemas/users", `user-${userId}`, "main.json");
|
||||
/** @type {DSQL_DatabaseSchemaType[]} */ let userDbSchema = JSON.parse(fs.readFileSync(userSchemaPath, "utf-8"));
|
||||
const userSchemaPath = path.resolve(String(process.env.DSQL_USER_DB_SCHEMA_PATH), `user-${userId}`, "main.json");
|
||||
/** @type {import("@/package-shared/types").DSQL_DatabaseSchemaType[]} */ let userDbSchema = JSON.parse(fs.readFileSync(userSchemaPath, "utf-8"));
|
||||
const targetDbIndex = userDbSchema.findIndex((db)=>db.dbFullName == database.db_full_name);
|
||||
if (targetDbIndex < 0) {
|
||||
throw new Error("Target Database not found in user schema data");
|
||||
@@ -245,35 +245,7 @@ const { URL } = __webpack_require__(7310);
|
||||
});
|
||||
////////////////////////////////////////
|
||||
}
|
||||
} // const userSchemaPath = path.resolve(
|
||||
// process.cwd(),
|
||||
// "jsonData/dbSchemas/users",
|
||||
// `user-${user.id}`,
|
||||
// "main.json"
|
||||
// );
|
||||
// if (!fs.existsSync(userSchemaPath))
|
||||
// throw new Error("User Shcema data file doesn't exist!");
|
||||
// /** @type {DSQL_DatabaseSchemaType[]} */
|
||||
// let userDbSchema = JSON.parse(fs.readFileSync(userSchemaPath, "utf-8"));
|
||||
// const targetDbIndex = userDbSchema.findIndex(
|
||||
// (db) => db.dbFullName == dbSchema?.dbFullName
|
||||
// );
|
||||
// if (targetDbIndex < 0)
|
||||
// throw new Error(
|
||||
// "Target Database for handshake not found in user schema data"
|
||||
// );
|
||||
// userDbSchema[targetDbIndex] = targetDb;
|
||||
// userDbSchema[targetDbIndex].dbName = dbSchema.dbName;
|
||||
// userDbSchema[targetDbIndex].dbFullName = dbSchema.dbFullName;
|
||||
// userDbSchema[targetDbIndex].dbSlug = dbSchema.dbSlug;
|
||||
// userDbSchema[targetDbIndex].dbDescription = dbSchema.dbDescription;
|
||||
// userDbSchema[targetDbIndex].dbImage = dbSchema.dbImage;
|
||||
// fs.writeFileSync(userSchemaPath, JSON.stringify(userDbSchema), "utf-8");
|
||||
// const targetPath = path.join(process.cwd(), "shell");
|
||||
// const dbShellUpdate = execSync(
|
||||
// `node createDbFromSchema.js --user ${user.id}`,
|
||||
// { cwd: targetPath }
|
||||
// );
|
||||
}
|
||||
|
||||
|
||||
/***/ })
|
||||
@@ -285,7 +257,7 @@ const { URL } = __webpack_require__(7310);
|
||||
var __webpack_require__ = require("../../../webpack-api-runtime.js");
|
||||
__webpack_require__.C(exports);
|
||||
var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId))
|
||||
var __webpack_exports__ = __webpack_require__.X(0, [5425,2224,2163,6825,3017,3403,7547,5886], () => (__webpack_exec__(2917)));
|
||||
var __webpack_exports__ = __webpack_require__.X(0, [2224,2163,6825,3017,3403,7547,5886], () => (__webpack_exec__(2917)));
|
||||
module.exports = __webpack_exports__;
|
||||
|
||||
})();
|
||||
File diff suppressed because one or more lines are too long
@@ -182,7 +182,7 @@ const { URL } = __webpack_require__(7310);
|
||||
var __webpack_require__ = require("../../../webpack-api-runtime.js");
|
||||
__webpack_require__.C(exports);
|
||||
var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId))
|
||||
var __webpack_exports__ = __webpack_require__.X(0, [5425,2224,2163,6825,722], () => (__webpack_exec__(7034)));
|
||||
var __webpack_exports__ = __webpack_require__.X(0, [2224,2163,6825,722], () => (__webpack_exec__(7034)));
|
||||
module.exports = __webpack_exports__;
|
||||
|
||||
})();
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user