Skip to content

CURRENT_TIMESTAMP not possible anymore as default value #6698

Closed
@holtkamp

Description

@holtkamp

This mapping used to work < 2.5 to have the database use CURRENT_TIMESTAMP as a default value for a DateTime property:

<field name="creationTimestamp" type="datetime" column="creation_timestamp" nullable="false">
  <options>
    <option name="default">CURRENT_TIMESTAMP</option>
  </options>
</field>

It resulted in SQL DDL like:

creation_timestamp DATETIME DEFAULT CURRENT_TIMESTAMP

As of 2.5 it seems the default value seems to be "properly" respected and result in:

creation_timestamp DATETIME DEFAULT 'CURRENT_TIMESTAMP'

When using MySQL such SQL returns an error: Invalid default value for 'creation_timestamp'

This was also mention on StackOverflow.

Not sure if the new 'behaviour' is intended behaviour?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions