Skip to content

[Rails5] Fix MysqlDateTimeWithTimeZone in rails 5

Jan Provaznik requested to merge jprovazn-rails5-mysql-datetime into master

What does this MR do?

Mysql fixes for Rails 5

  • MysqlDateTimeWithTimeZone inherits from ActiveRecord::Type::DateTime (MysqlDateTime is not present in Rails 5)
  • explicitly set NULL default value for merge_request_diff_files's diff column (otherwise empty string is used in a migration) and empty string is not allowed for text/blob fields in Mysql
  • disable NO_ZERO_DATE mode for all Mysql DB connections, otherwise SQL queries fail on inserting 0 value for created_at column. To make sure that configure_connection patch takes effect, this patch is loaded right in the config/application.rb before Rails connects to DB.

Are there points in the code the reviewer needs to double check?

Why was this MR needed?

Screenshots (if relevant)

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

Closes #46275 (closed)

Edited by Yorick Peterse

Merge request reports