Bug fix: Check structure

This commit is contained in:
Sam 2024-11-26 23:28:03 +01:00
parent 85499e837c
commit fc19ac2672

View File

@ -320,6 +320,11 @@ class Instance {
errors: [], errors: [],
passed: [] passed: []
} }
for (let col of dbStruc){ // Check if current table has a field that is not defined
if (!desiredStructure.find(dsStruc => dsStruc.Field === col.Field)){
result.errors.push(`${col.Field}: Existing, but not defined`);
}
}
for (let col of desiredStructure){ for (let col of desiredStructure){
const dbCol = dbStruc.find((dbCol) => col.Field === dbCol.Field); // Check if the current table has the field const dbCol = dbStruc.find((dbCol) => col.Field === dbCol.Field); // Check if the current table has the field
if (!dbCol) { if (!dbCol) {