Bug Fixes

This commit is contained in:
Benjamin Toby
2024-11-05 15:18:40 +01:00
parent 3cdf78e58d
commit 748ff55092
507 changed files with 3719 additions and 1231 deletions
+3 -18
View File
@@ -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");
// }
}
////////////////////////////////////////
+1 -1
View File
@@ -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({