aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/mysql/schema_dumper.rb
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2016-02-12 07:01:04 +0900
committerRyuta Kamizono <kamipo@gmail.com>2016-03-12 18:26:41 +0900
commit98fb37449e57ab1d956de0ff1d1e309f8b28814b (patch)
tree5af5851914eff42e19096a0f2ae18a545711f7e6 /activerecord/lib/active_record/connection_adapters/mysql/schema_dumper.rb
parent9201030320d09bb2ec76a7cc59aa58f77f984995 (diff)
downloadrails-98fb37449e57ab1d956de0ff1d1e309f8b28814b.tar.gz
rails-98fb37449e57ab1d956de0ff1d1e309f8b28814b.tar.bz2
rails-98fb37449e57ab1d956de0ff1d1e309f8b28814b.zip
Primary key should be `NOT NULL`
Follow up to #18228. In MySQL and PostgreSQL, primary key is to be `NOT NULL` implicitly. But in SQLite it must be specified `NOT NULL` explicitly.
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/mysql/schema_dumper.rb')
-rw-r--r--activerecord/lib/active_record/connection_adapters/mysql/schema_dumper.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/mysql/schema_dumper.rb b/activerecord/lib/active_record/connection_adapters/mysql/schema_dumper.rb
index be40df4101..2ba9657f24 100644
--- a/activerecord/lib/active_record/connection_adapters/mysql/schema_dumper.rb
+++ b/activerecord/lib/active_record/connection_adapters/mysql/schema_dumper.rb
@@ -7,7 +7,7 @@ module ActiveRecord
spec = { id: :bigint.inspect }
spec[:default] = schema_default(column) || 'nil' unless column.auto_increment?
else
- spec = super.except!(:null)
+ spec = super
end
spec[:unsigned] = 'true' if column.unsigned?
spec