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>
(cherry picked from commit da17bc0f91)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
This commit is contained in:
Jonathan Druart 2025-06-17 11:47:11 +02:00 committed by Paul Derscheid
parent 42e1049bfd
commit 62bcd78596
No known key found for this signature in database
GPG Key ID: C25F9FD44CED595B
1 changed files with 5 additions and 0 deletions

View File

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