ruby on rails - Create Migration for Column with a Number in the Name -


i'm porting app rails , couple of columns named things like

2nd_phone 2nd_address

when try doing migration using t.string :2nd_phone

i syntax error, unexpected tinteger, expecting tstring_content or tstring_dbeg or tstring_dvar or tstring_end

any ideas how in rals?

in migration file have quotes support starting character numeric 1 , run rake db:migrate

t.string :'2nd_phone' 

while doing way if want create new record need have this:

model.create(:'2nd_phone'=> 'your value') 

Comments

Popular posts from this blog

java - Ebean enhancement ignores a model -

ubuntu - How to disable Kernel Module Signing in linux -

SQL php on different pages to Insert (mysqli) -