qoyyim qoyyim - 1 year ago 117
Ruby Question

add column with default in lhm (Large Hadron Migrator)

I tried to add column with default value like

Lhm.change_table :recomendations do |m|
m.add_column :amount, "TINYINT", default: 1

but got error: wrong number of arguments (given 3, expected 2) gems/lhm-2.2.0/lib/lhm/migrator.rb:55:in `add_column'

what the correct code should be?

Answer Source

just realized it's just appending string to sql, just add default, not null etc like SQL

m.add_column :amount, "TINYINT DEFAULT 1"
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download