Skip to content

Timestamp field with default value on creation #90

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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