Skip to content

Commit

Permalink
Date columns must have an explicit default value
Browse files Browse the repository at this point in the history
  • Loading branch information
OmarHawk committed Aug 27, 2024
1 parent 2b599c0 commit 6c2ea84
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ import org.hibernate.type.SqlTypes;
<%_ } else if (fieldTypeUuidAndMysqlDbType) { _%>
, length = 36
<%_ } _%>
<%_ if (field.fieldValidate === true) { _%>
<%_ if (field.fieldValidationMaxLength && !fieldTypeUuidAndMysqlDbType) { _%>
, length = <%= field.fieldValidateRulesMaxlength %>
Expand Down
12 changes: 10 additions & 2 deletions test-integration/samples/.jhipster/FieldTestEntity.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,18 @@
{ "fieldName": "localDateReadonly", "fieldType": "LocalDate", "options": { "readonly": true } },
{ "fieldName": "localDateRequiredTom", "fieldType": "LocalDate", "fieldValidateRules": ["required"] },
{ "fieldName": "instantTom", "fieldType": "Instant" },
{ "fieldName": "instantReadonly", "fieldType": "Instant", "options": { "readonly": true } },
{
"fieldName": "instantReadonly",
"fieldType": "Instant",
"options": { "defaultValue": "2024-08-09 12:30:45.123456", "readonly": true }
},
{ "fieldName": "instantRequiredTom", "fieldType": "Instant", "fieldValidateRules": ["required"] },
{ "fieldName": "zonedDateTimeTom", "fieldType": "ZonedDateTime" },
{ "fieldName": "zonedDateReadonly", "fieldType": "ZonedDateTime", "options": { "readonly": true } },
{
"fieldName": "zonedDateTimeReadonly",
"fieldType": "ZonedDateTime",
"options": { "defaultValue": "2024-08-09 12:30:45.123456", "readonly": true }
},
{ "fieldName": "zonedDateTimeRequiredTom", "fieldType": "ZonedDateTime", "fieldValidateRules": ["required"] },
{ "fieldName": "durationTom", "fieldType": "Duration" },
{ "fieldName": "durationRequiredTom", "fieldType": "Duration", "fieldValidateRules": ["required"] },
Expand Down

0 comments on commit 6c2ea84

Please sign in to comment.