diff options
author | fatkodima <fatkodima@rambler.ru> | 2017-12-25 23:41:28 +0200 |
---|---|---|
committer | fatkodima <fatkodima@rambler.ru> | 2017-12-25 23:42:18 +0200 |
commit | 55eea4e42d557037600c71556700bb82fcebcb0a (patch) | |
tree | 62e5d55a8d3233e538c594b856c0753097823960 /activerecord/lib | |
parent | 237397e41a6a71fbc8424201a21cad00e132ff21 (diff) | |
download | rails-55eea4e42d557037600c71556700bb82fcebcb0a.tar.gz rails-55eea4e42d557037600c71556700bb82fcebcb0a.tar.bz2 rails-55eea4e42d557037600c71556700bb82fcebcb0a.zip |
Fix `add_column` with :primary_key type compatibility for SQLite
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb b/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb index c72db15ce3..a8c3318905 100644 --- a/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb @@ -297,7 +297,7 @@ module ActiveRecord end def add_column(table_name, column_name, type, options = {}) #:nodoc: - if valid_alter_table_type?(type) + if valid_alter_table_type?(type) && !options[:primary_key] super(table_name, column_name, type, options) else alter_table(table_name) do |definition| |