Bug Fixes
This commit is contained in:
@@ -242,7 +242,9 @@ module.exports = async function updateTable({
|
||||
].fields;
|
||||
|
||||
fs.writeFileSync(
|
||||
`./../jsonData/dbSchemas/users/user-${userId}/main.json`,
|
||||
`${String(
|
||||
process.env.DSQL_USER_DB_SCHEMA_PATH
|
||||
)}/user-${userId}/main.json`,
|
||||
JSON.stringify(userSchemaData),
|
||||
"utf8"
|
||||
);
|
||||
@@ -539,23 +541,6 @@ module.exports = async function updateTable({
|
||||
database: dbFullName,
|
||||
queryString: finalQueryString,
|
||||
});
|
||||
|
||||
/**
|
||||
* @description Delete foreignKey from User db schema if INSERT fails
|
||||
*/
|
||||
// if (!addForeignKey?.serverStatus) {
|
||||
// const userSchemaData = dbSchema;
|
||||
|
||||
// const targetDbIndex = userSchemaData.findIndex((db) => db.dbFullName === dbFullName);
|
||||
// const targetTableIndex = userSchemaData[targetDbIndex].tables.findIndex((table) => table.tableName === tableName);
|
||||
// const targetFieldIndex = userSchemaData[targetDbIndex].tables[targetTableIndex].fields.findIndex((field) => field.fieldName === fieldName);
|
||||
|
||||
// console.log(userSchemaData[targetDbIndex].tables[targetTableIndex].fields[targetFieldIndex]);
|
||||
|
||||
// delete userSchemaData[targetDbIndex].tables[targetTableIndex].fields[targetFieldIndex].foreignKey;
|
||||
|
||||
// fs.writeFileSync(`./../jsonData/dbSchemas/users/user-${userId}/main.json`, JSON.stringify(userSchemaData), "utf8");
|
||||
// }
|
||||
}
|
||||
|
||||
////////////////////////////////////////
|
||||
|
||||
@@ -11,7 +11,7 @@ const dbHandler = require("./dbHandler");
|
||||
* @param {string} params.queryString - SQL string
|
||||
* @param {string[]} [params.queryValuesArray] - Values Array
|
||||
* @param {string} [params.database] - Database name
|
||||
* @param {DSQL_TableSchemaType} [params.tableSchema] - Table schema
|
||||
* @param {import("@/package-shared/types").DSQL_TableSchemaType} [params.tableSchema] - Table schema
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
module.exports = async function varDatabaseDbHandler({
|
||||
|
||||
Reference in New Issue
Block a user