From 7ce51548acc8fe27ec9325a9a9583e22edbc2822 Mon Sep 17 00:00:00 2001 From: Jasper Maes Date: Mon, 9 Jul 2018 23:07:57 +0200 Subject: [PATCH] Rails5 MySQL fix rename_column as part of cleanup_concurrent_column_type_change --- changelogs/unreleased/rails5-mysql-rename-column.yml | 5 +++++ config/initializers/active_record_table_definition.rb | 5 +++++ 2 files changed, 10 insertions(+) create mode 100644 changelogs/unreleased/rails5-mysql-rename-column.yml diff --git a/changelogs/unreleased/rails5-mysql-rename-column.yml b/changelogs/unreleased/rails5-mysql-rename-column.yml new file mode 100644 index 00000000000..cbae9250744 --- /dev/null +++ b/changelogs/unreleased/rails5-mysql-rename-column.yml @@ -0,0 +1,5 @@ +--- +title: Rails5 MySQL fix rename_column as part of cleanup_concurrent_column_type_change +merge_request: 20514 +author: Jasper Maes +type: fixed diff --git a/config/initializers/active_record_table_definition.rb b/config/initializers/active_record_table_definition.rb index 8e3a1c7a62f..a71069f27a3 100644 --- a/config/initializers/active_record_table_definition.rb +++ b/config/initializers/active_record_table_definition.rb @@ -29,6 +29,11 @@ module ActiveRecord def datetime_with_timezone(column_name, **options) column(column_name, :datetime_with_timezone, options) end + + # Disable timestamp alias to datetime + def aliased_types(name, fallback) + fallback + end end end end