Skip to content

Use now() as default timestamp for MySQL

Lin Jen-Shin requested to merge use-1-for-mysql-default-timestamp into master

What does this MR do?

Use now() as default timestamp for MySQL

Why was this MR needed?

This patch was originally from https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/13560 which tried to stop MySQL from using CURRENT_TIMESTAMP. However, as it seems, on some MySQL version (e.g. 4.7) and under some configuration, 0 is not allowed.

We never intended to use the default value, so any value should be fine. However, now() is picked because there's some weird issue in factory_girl along with MySQL, which stops Rails auto-generating timestamps, causing it use the default. Use now() could somehow "fix" this issue when it happened.

Does this MR meet the acceptance criteria?

  • Changelog entry added, if necessary
  • Review
    • Has been reviewed by Backend
    • Has been reviewed by Database

What are the relevant issue numbers?

Edited by Lin Jen-Shin

Merge request reports