Skip to content

Timestamp field with default value on creation #90

@mcasto

Description

@mcasto

I'm trying to create a timestamp field that defaults to the current timestamp (a "created_at" field).

I've tried ->defaultValue('CURRENT_TIMESTAMP') and ->defaultValue('NOW()') ... both return errors saying it's an invalid default value.

I can't find anything about this situation in the documentation, but it seems like a common enough task that it should be pretty simple ... and I suspect I'm missing something obvious.

Thanks in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions