diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-02-23 15:36:48 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-02-23 15:36:48 -0300 |
commit | acb12d3f4ff80cf8cf7c6739b888e267110c6d30 (patch) | |
tree | 450cfbddabae32d42160d7eec0c5e7b41ce6377b /activerecord/lib/active_record | |
parent | 88c3bf4c483be31bb95a6c0ad6f537a8e8aa7eee (diff) | |
parent | b8d320c1294aa582ff34e1b15782c084edc0386b (diff) | |
download | rails-acb12d3f4ff80cf8cf7c6739b888e267110c6d30.tar.gz rails-acb12d3f4ff80cf8cf7c6739b888e267110c6d30.tar.bz2 rails-acb12d3f4ff80cf8cf7c6739b888e267110c6d30.zip |
Merge pull request #17631 from kamipo/bigint_pk_support
Allow limit option for MySQL bigint primary key support.
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb | 10 |
1 files changed, 10 insertions, 0 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 8db4bcd7e3..e11eaabf4b 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb @@ -11,6 +11,16 @@ module ActiveRecord options[:auto_increment] ||= type == :bigint super end + + def new_column_definition(name, type, options) # :nodoc: + column = super + case column.type + when :primary_key + column.type = :integer + column.auto_increment = true + end + column + end end class SchemaCreation < AbstractAdapter::SchemaCreation |