Skip to content

Commit

Permalink
Fix not intager pk unsigned bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Genki Sugawara committed Apr 13, 2015
1 parent 5995f21 commit c896fd9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/ridgepole/ext/mysql_awesome.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ class ActiveRecord::ConnectionAdapters::TableDefinition
alias primary_key_without_unsigned primary_key

def primary_key(name, type = :primary_key, options = {})
primary_key_without_unsigned(name, type, options.merge(primary_key: true).reverse_merge(unsigned: true))
if options.has_key?(:id)
primary_key_without_unsigned(name, type, options)
else
primary_key_without_unsigned(name, type, options.merge(primary_key: true).reverse_merge(unsigned: true))
end
end
end

0 comments on commit c896fd9

Please sign in to comment.