Skip to content

Commit

Permalink
Set default of primary_key column to be unsigned.
Browse files Browse the repository at this point in the history
At CNTRAL, we default our primary keys to be unsigned. As of Rails 5+, there is not clean way to do this in a monkey patch so we fork the rails repo and made this adjustment.
  • Loading branch information
joshuapinter committed Jul 31, 2024
1 parent 9089ade commit 2d65678
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ def new_column_definition(name, type, **options) # :nodoc:
type = :integer
options[:limit] ||= 8
options[:primary_key] = true
options[:unsigned] ||= true # NOTE: At CNTRAL, we default our primary keys to be unsigned. As of Rails 5+, there is not clean way to do this in a monkey patch so we fork the rails repo and made this adjustment.
when /\Aunsigned_(?<type>.+)\z/
type = $~[:type].to_sym
options[:unsigned] = true
Expand Down

0 comments on commit 2d65678

Please sign in to comment.