module Uuidable::TableDefinition

Module adds method to table definition

Public Instance Methods

uuid(opts = {}) click to toggle source
# File lib/uuidable/migration.rb, line 9
def uuid(opts = {})
  index_opts = opts.delete(:index)
  index_opts = {} if index_opts.nil?

  column_name = opts.delete(:column_name) || COLUMN_NAME

  column column_name, COLUMN_TYPE, COLUMN_OPTIONS.merge(opts)
  index column_name, INDEX_OPTIONS.merge(index_opts) if index_opts
end