Rails - how to store large numbers like 100000076685963

前端 未结 3 998
一个人的身影
一个人的身影 2021-01-14 11:58

I need to store large numbers like :100000076685963

Which are to big for a db field type of integer. In my db migration I use:

  t.integer :fb_uid
         


        
3条回答
  •  無奈伤痛
    2021-01-14 12:33

    Try float

    t.float :fb_uid
    

    And seems like this is something to do with Facebook (probably facebooker) and assuming these numbers will not use as arithmetic operations, you could probably use just string

    t.string :fb_uid
    

提交回复
热议问题