Module: RC::PrimaryKey

Instance Method Summary collapse

Instance Method Details

#add_primary_key(table, options = {}) ⇒ Object



3
4
5
6
7
# File 'lib/rein/constraint/primary_key.rb', line 3

def add_primary_key(table, options = {})
  attribute = "id".to_sym
  sql = "ALTER TABLE #{table} ADD PRIMARY KEY (#{attribute})"
  execute(sql)
end