Skip to content

table.timestamps() should set ON UPDATE CURRENT_TIMESTAMP for updated_ts #1928

Open
@jsnajdr

Description

@jsnajdr

Expected:
When creating the updated_ts column in table.timestamps(), its DDL should be:

timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP

Actual:
The ON UPDATE CURRENT_TIMESTAMP part is missing - the updated_ts column is never autoupdated.

The syntax I'm describing works for MySQL, I'm not sure how compatible across database engines it is.

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