diff options
author | Matthew Draper <matthew@trebex.net> | 2017-12-20 10:47:36 +1030 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-20 10:47:36 +1030 |
commit | 08b9d8b3e05ef07a8f16245446cb62ca4f265dbb (patch) | |
tree | 7c574be59de9ccea054eafce5e05ddf7b57473e9 /activerecord/lib | |
parent | c6cd9a59f200863ccfe8ad1d9c5a8876c39b9c5c (diff) | |
parent | 95b6a198ef4a94dc060faa70284ffdfae51006f6 (diff) | |
download | rails-08b9d8b3e05ef07a8f16245446cb62ca4f265dbb.tar.gz rails-08b9d8b3e05ef07a8f16245446cb62ca4f265dbb.tar.bz2 rails-08b9d8b3e05ef07a8f16245446cb62ca4f265dbb.zip |
Merge pull request #31177 from albertoalmagro/remove-default-mysql-engine-from-ar-5-2
Remove default ENGINE=InnoDB for Mysql2 adapter
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb | 2 | ||||
-rw-r--r-- | activerecord/lib/active_record/migration/compatibility.rb | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb b/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb index bff2f51efd..824839c195 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb @@ -293,7 +293,7 @@ module ActiveRecord end def create_table(table_name, **options) #:nodoc: - super(table_name, options: "ENGINE=InnoDB", **options) + super(table_name, options: "", **options) end def bulk_change_table(table_name, operations) #:nodoc: diff --git a/activerecord/lib/active_record/migration/compatibility.rb b/activerecord/lib/active_record/migration/compatibility.rb index bd8c054c28..7ae8073478 100644 --- a/activerecord/lib/active_record/migration/compatibility.rb +++ b/activerecord/lib/active_record/migration/compatibility.rb @@ -28,6 +28,14 @@ module ActiveRecord super end end + + def create_table(table_name, options = {}) + if adapter_name == "Mysql2" + super(table_name, options: "ENGINE=InnoDB", **options) + else + super + end + end end class V5_0 < V5_1 |