mirror of
https://github.com/Fabio286/antares.git
synced 2025-06-05 21:59:22 +02:00
fix: cut faker text based on field length
This commit is contained in:
@ -240,8 +240,11 @@ export default (connections) => {
|
||||
else { // Faker value
|
||||
let fakeValue = faker[params.row[key].group][params.row[key].method]();
|
||||
|
||||
if ([...TEXT, ...LONG_TEXT].includes(type))
|
||||
if ([...TEXT, ...LONG_TEXT].includes(type)) {
|
||||
if (params.row[key].length)
|
||||
fakeValue = fakeValue.substr(0, params.row[key].length);
|
||||
fakeValue = `"${sqlEscaper(fakeValue)}"`;
|
||||
}
|
||||
else if ([...DATE, ...DATETIME].includes(type))
|
||||
fakeValue = `"${moment(fakeValue).format('YYYY-MM-DD HH:mm:ss.SSSSSS')}"`;
|
||||
|
||||
|
Reference in New Issue
Block a user