Class: ActiveRecord::ConnectionAdapters::TableDefinition

Inherits:
Object
  • Object
show all
Defined in:
lib/active_record/connection_adapter_with_uuid.rb

Instance Method Summary collapse

Instance Method Details

#uuid(*args) ⇒ Object

Adds hstore type for migrations. So you can add columns to a table like:

create_table :people, :id => false do |t|
  ...
  t.uuid :id, :null => false
  ...
end


12
13
14
15
16
# File 'lib/active_record/connection_adapter_with_uuid.rb', line 12

def uuid(*args)
  options = args.extract_options!
  column_names = args
  column_names.each { |name| column(name, 'uuid', options) }
end