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
|
else { // Faker value
|
||||||
let fakeValue = faker[params.row[key].group][params.row[key].method]();
|
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)}"`;
|
fakeValue = `"${sqlEscaper(fakeValue)}"`;
|
||||||
|
}
|
||||||
else if ([...DATE, ...DATETIME].includes(type))
|
else if ([...DATE, ...DATETIME].includes(type))
|
||||||
fakeValue = `"${moment(fakeValue).format('YYYY-MM-DD HH:mm:ss.SSSSSS')}"`;
|
fakeValue = `"${moment(fakeValue).format('YYYY-MM-DD HH:mm:ss.SSSSSS')}"`;
|
||||||
|
|
||||||
|
@ -197,7 +197,8 @@ export default {
|
|||||||
this.$emit('update:value', {
|
this.$emit('update:value', {
|
||||||
group: this.selectedGroup,
|
group: this.selectedGroup,
|
||||||
method: this.selectedMethod,
|
method: this.selectedMethod,
|
||||||
value: this.selectedValue
|
value: this.selectedValue,
|
||||||
|
length: this.fieldLength
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user