Module: ActiveUUID::Patches::Migrations
- Defined in:
- lib/activeuuid/patches.rb
Instance Method Summary collapse
Instance Method Details
#uuid(*column_names) ⇒ Object
47 48 49 50 51 52 53 |
# File 'lib/activeuuid/patches.rb', line 47 def uuid(*column_names) = column_names. column_names.each do |name| type = ActiveRecord::Base.connection.adapter_name.casecmp("postgresql").zero? ? "uuid" : "binary(16)" column(name, "#{type}#{' PRIMARY KEY' if .delete(:primary_key)}", ) end end |