Skip to content

Commit

Permalink
Try if specifying :00 for fake data does resolve failing loading of f…
Browse files Browse the repository at this point in the history
…ake data

for MariaDB / h2
  • Loading branch information
OmarHawk committed Jan 16, 2025
1 parent f5bc909 commit c59d929
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions generators/base-application/support/prepare-field.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ function generateFakeDataForField(
} else if (field.fieldType === LOCAL_TIME) {
// time without seconds by default
const timeWithoutMilliseconds = originalData.split('T')[1].split('.')[0];
// default time input fields are set to support HH:mm only. Would produce validation errors otherwise.
data = timeWithoutMilliseconds.substring(0, timeWithoutMilliseconds.lastIndexOf(':'));
// default time input fields are set to support HH:mm. Some databases require :00 during loading of fake data to detect the datatype.
data = `${timeWithoutMilliseconds.substring(0, timeWithoutMilliseconds.lastIndexOf(':'))}:00`;
} else if (type === 'json-serializable') {
data = date;
} else {
Expand Down

0 comments on commit c59d929

Please sign in to comment.