Module: ActiveUUID::Patches::Migrations
- Defined in:
- lib/activeuuid/patches.rb
Instance Method Summary collapse
Instance Method Details
#uuid(*column_names) ⇒ Object
38 39 40 41 42 43 44 |
# File 'lib/activeuuid/patches.rb', line 38 def uuid(*column_names) = column_names. column_names.each do |name| type = ActiveRecord::Base.connection.adapter_name.downcase == 'postgresql' ? 'uuid' : 'binary(16)' column(name, "#{type}#{' PRIMARY KEY' if .delete(:primary_key)}", ) end end |