Bug 40174: Deal with enum

Data too long for column 'checkprevcheckout'

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Jonathan Druart 2025-06-17 11:47:11 +02:00 committed by Lucas Gass
parent 9ca9d1e764
commit da17bc0f91
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
1 changed files with 5 additions and 0 deletions

View File

@ -6,6 +6,11 @@ const fs = require("fs");
const generatedDataCache = new Set();
const generateMockData = (type, properties) => {
if (properties.hasOwnProperty("enum")) {
let values = properties.enum;
return values[Math.floor(Math.random() * values.length)];
}
switch (type) {
case "string":
if (properties?.maxLength) {