diff options
author | James Edwards-Jones <jedwardsjones@gitlab.com> | 2017-10-19 17:47:11 +0300 |
---|---|---|
committer | James Edwards-Jones <jedwardsjones@gitlab.com> | 2017-12-07 18:07:27 +0300 |
commit | d2ebc9b931d12cb2cb120d6f7c940744bc1be39c (patch) | |
tree | 2a5d0b64d39126ac968ac85ba529fc6c3fb8ea6a /config | |
parent | 7619bdd6594e12a51594fa2f3fd47291579db5da (diff) |
Prevent schema.rb reverting from datetime_with_timezone to datetime
Diffstat (limited to 'config')
-rw-r--r-- | config/initializers/active_record_data_types.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/config/initializers/active_record_data_types.rb b/config/initializers/active_record_data_types.rb index fef591c397d..0359e14b232 100644 --- a/config/initializers/active_record_data_types.rb +++ b/config/initializers/active_record_data_types.rb @@ -79,3 +79,8 @@ elsif Gitlab::Database.mysql? NATIVE_DATABASE_TYPES[:datetime_with_timezone] = { name: 'timestamp' } end end + +# Ensure `datetime_with_timezone` columns are correctly written to schema.rb +if (ActiveRecord::Base.connection.active? rescue false) + ActiveRecord::Base.connection.send :reload_type_map +end |