I have contact_number in my customers table using the field integer. I tried creating a record in rails c but apparently it can't store a larger field of numbers. I looked around online I think I should use float instead of integer given a precision of 10 numbers like in the states
my thought is to create a new migration with
class ChangeContactNumberInCustomerTableToFloatFromInteger < ActiveRecord::Migration
def change_table
remove_column :customers, :contact_number, :integer
add_column :customers, :contact_number, :float
end
end
how do I specify the precision and is this the correct way in doing this?
float. This type has limited precision. @Teeg's suggestion of storing asstringmake sense.