Skip to content

Commit

Permalink
Add check for impossible noninline relation arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
Marlamin committed Nov 24, 2024
1 parent 0289594 commit 146e2e8
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions code/C#/DBDefsValidator/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,20 @@ static void Main(string[] args)
Console.ResetColor();
}
}

foreach (var versionDefinition in definition.Value.versionDefinitions)
{
foreach (var column in versionDefinition.definitions)
{
if (column.isRelation && column.isNonInline && column.arrLength > 1)
{
errorEncountered.Add(definition.Key);
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine(definition.Key + "." + column.name + " is a non-inline relation with an array length greater than 1 (" + column.arrLength + ")!");
Console.ResetColor();
}
}
}
}

Console.WriteLine("Checked " + foreignKeys + " foreign keys!");
Expand Down Expand Up @@ -179,6 +193,7 @@ static void Main(string[] args)
Console.WriteLine("There have been errors in the following DBDs:");
foreach (var dbName in errorEncountered)
Console.WriteLine(" - " + dbName);
Console.ResetColor();
Environment.Exit(1);
}
else
Expand Down

0 comments on commit 146e2e8

Please sign in to comment.