Skip to content

Sanity check for addTimestamps() function #535

Description

@amcnea

I tried using the addTimestamps() function today and what happened seemed to me to be incorrect behavior. When doing a DESC on my mysql table I got back the following:

+--------------+--------------+------+-----+-------------------+-----------------------------+
| Field        | Type         | Null | Key | Default           | Extra                       |
+--------------+--------------+------+-----+-------------------+-----------------------------+
| created_at   | timestamp    | NO   |     | CURRENT_TIMESTAMP | on update CURRENT_TIMESTAMP |
| updated_at   | timestamp    | YES  |     | NULL              |                             |
+--------------+--------------+------+-----+-------------------+-----------------------------+

I would expect the Extra field of 'on update CURRENT_TIMESTAMP' to be attached to the updated_at field not the created_at field. I don't know that this is incorrect behavior, but it is not what I would have expected to occur, so, I figured I would at least point it out. If you could please let me know if this is the intended behavior which Phinx wants or if this is an actual issue.

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    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