Hi,
i have column name phone with integer datatype but when i enter phone
number it throws an error
"1325565488 is out of range for ActiveRecord::Type::Integer with limit
4"

i have changed limit to 8 in migration file but still it didn't work.

Any kind suggestions would be appreciated. Thanks

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/ffb4a1a1018546058e1a326469ef73b8%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Robby O'Connor at Mar 24, 2016 at 9:50 pm
    Use a string.

    --Rob
    Sent from my cell, please excuse any typos.
    On Mar 24, 2016 5:49 PM, "Ramu Goud" wrote:

    Hi,
    i have column name phone with integer datatype but when i enter phone
    number it throws an error
    "1325565488 is out of range for ActiveRecord::Type::Integer with limit
    4"

    i have changed limit to 8 in migration file but still it didn't work.

    Any kind suggestions would be appreciated. Thanks

    --
    Posted via http://www.ruby-forum.com/.

    --
    You received this message because you are subscribed to the Google Groups
    "Ruby on Rails: Talk" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to rubyonrails-talk+unsubscribe@googlegroups.com.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    To view this discussion on the web visit
    https://groups.google.com/d/msgid/rubyonrails-talk/ffb4a1a1018546058e1a326469ef73b8%40ruby-forum.com
    .
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAPncwv%2B_9%3DqH7a4zrkoah2KB%3Ds_VuM6veqq0f01XEXhLno7o7Q%40mail.gmail.com.
    For more options, visit https://groups.google.com/d/optout.
  • Ramu Goud at Mar 24, 2016 at 9:55 pm
    Use string where???? i'm just a beginner so can u tell me that in detail

    --
    Posted via http://www.ruby-forum.com/.

    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/6fd7d7f749663e95ecce4271909fa3cf%40ruby-forum.com.
    For more options, visit https://groups.google.com/d/optout.
  • Colin Law at Mar 24, 2016 at 9:57 pm

    On 24 March 2016 at 21:54, Ramu Goud wrote:
    Use string where???? i'm just a beginner so can u tell me that in detail
    As the datatype for the column in the database.

    Colin

    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLvvxTK7a%3D_TYwAjhDiuw1NVmH2HPzKdmsvjaz-txjEuSw%40mail.gmail.com.
    For more options, visit https://groups.google.com/d/optout.
  • Robby O'Connor at Mar 24, 2016 at 9:59 pm
    Use a string data type for the number.

    --Rob
    Sent from my cell, please excuse any typos.
    On Mar 24, 2016 5:55 PM, "Ramu Goud" wrote:

    Use string where???? i'm just a beginner so can u tell me that in detail

    --
    Posted via http://www.ruby-forum.com/.

    --
    You received this message because you are subscribed to the Google Groups
    "Ruby on Rails: Talk" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to rubyonrails-talk+unsubscribe@googlegroups.com.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    To view this discussion on the web visit
    https://groups.google.com/d/msgid/rubyonrails-talk/6fd7d7f749663e95ecce4271909fa3cf%40ruby-forum.com
    .
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAPncwvJAWMsrFxxQikkviH4Rbh%2B3Yw8nazaMdoYwWP2eb6Vdmg%40mail.gmail.com.
    For more options, visit https://groups.google.com/d/optout.
  • Naveed Alam at Mar 26, 2016 at 9:25 am

    Ramu Goud wrote in post #1182441:
    Hi,
    i have column name phone with integer datatype but when i enter phone
    number it throws an error
    "1325565488 is out of range for ActiveRecord::Type::Integer with limit
    4"
    goto your db folder and in the migration change the phone number field
    data type from integer to string. and thats all. but u will will to do
    rake db:migrate
    after that.

    --
    Posted via http://www.ruby-forum.com/.

    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/267322f1b9b5fb58817f85582e4463d3%40ruby-forum.com.
    For more options, visit https://groups.google.com/d/optout.
  • Colin Law at Mar 26, 2016 at 9:36 am

    On 26 March 2016 at 09:25, Naveed Alam wrote:
    Ramu Goud wrote in post #1182441:
    Hi,
    i have column name phone with integer datatype but when i enter phone
    number it throws an error
    "1325565488 is out of range for ActiveRecord::Type::Integer with limit
    4"
    goto your db folder and in the migration change the phone number field
    data type from integer to string. and thats all. but u will will to do
    rake db:migrate
    after that.
    It is best to add a new migration to do this.

    Colin

    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLv64QYK3z3oR5%2BjZtXMAHvm7fu3qU4mF2XvZ3M7z8A8Wg%40mail.gmail.com.
    For more options, visit https://groups.google.com/d/optout.
  • Tamouse pontiki at Mar 26, 2016 at 2:37 pm
    Sorry if this was duplicated -- I was trying to use Apple Mail again after
    all these years and suddenly remembered why I wasn't using it.

    On Sat, Mar 26, 2016 at 9:34 AM, tamouse pontiki wrote:

    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAHUC_t_b_vfPMu%2BTPs0sXdANMvu4Rxidnm2PkF7t9b%2BLJyi7nw%40mail.gmail.com.
    For more options, visit https://groups.google.com/d/optout.
  • Colin Law at Mar 26, 2016 at 2:56 pm

    On 26 March 2016 at 14:37, tamouse pontiki wrote:
    Sorry if this was duplicated -- I was trying to use Apple Mail again after
    all these years and suddenly remembered why I wasn't using it.
    Hi Tamouse, I don't think we received it once, let alone twice. At
    least I did not see it.

    Colin

    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLtgQ-ShmsabVaUgh8qbiNvLasMAcKopgqCOcJ7EKfxjYA%40mail.gmail.com.
    For more options, visit https://groups.google.com/d/optout.
  • Tamouse pontiki at Mar 27, 2016 at 3:36 am

    On Sat, Mar 26, 2016 at 4:35 AM, Colin Law wrote:
    On 26 March 2016 at 09:25, Naveed Alam wrote:
    Ramu Goud wrote in post #1182441:
    Hi,
    i have column name phone with integer datatype but when i enter phone
    number it throws an error
    "1325565488 is out of range for ActiveRecord::Type::Integer with limit
    4"
    goto your db folder and in the migration change the phone number field
    data type from integer to string. and thats all. but u will will to do
    rake db:migrate
    after that.
    It is best to add a new migration to do this.

    Colin
    ((this is what I tried to send))

    Agreed. If you change an old migration, and run `rake db:migrate` *NOTHING*
    will happen, because that migration is already saved in the database table
    'schema_migrations'. You either need to create a new migration, or you have
    to drop the data base and re-run all the migrations.

    I once tried to circumvent this in a panic situation by deleting the schema
    migration record and re-running the migration, but it was such a crazy
    thing to try, I gave up.

    My advice is to do just as Colin suggested, and use a *new* migration to
    change the table.

    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAHUC_t8cNyiPPnyp%2B6jceSFCS%2BOBgT1L%3Dw5fDKJSUe9E4XKDMA%40mail.gmail.com.
    For more options, visit https://groups.google.com/d/optout.
  • Walter Lee Davis at Mar 27, 2016 at 11:55 am

    On Mar 26, 2016, at 11:36 PM, tamouse pontiki wrote:



    On Sat, Mar 26, 2016 at 4:35 AM, Colin Law wrote:
    On 26 March 2016 at 09:25, Naveed Alam wrote:
    Ramu Goud wrote in post #1182441:
    Hi,
    i have column name phone with integer datatype but when i enter phone
    number it throws an error
    "1325565488 is out of range for ActiveRecord::Type::Integer with limit
    4"
    goto your db folder and in the migration change the phone number field
    data type from integer to string. and thats all. but u will will to do
    rake db:migrate
    after that.
    It is best to add a new migration to do this.

    Colin

    ((this is what I tried to send))

    Agreed. If you change an old migration, and run `rake db:migrate` *NOTHING* will happen, because that migration is already saved in the database table 'schema_migrations'. You either need to create a new migration, or you have to drop the data base and re-run all the migrations.

    I once tried to circumvent this in a panic situation by deleting the schema migration record and re-running the migration, but it was such a crazy thing to try, I gave up.

    My advice is to do just as Colin suggested, and use a *new* migration to change the table.
    It's helpful to think of migrations as "version control for your database". They capture the steps along the way to where you are now (the schema.rb is the current state, or HEAD, of your migrations).

    Walter
    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAHUC_t8cNyiPPnyp%2B6jceSFCS%2BOBgT1L%3Dw5fDKJSUe9E4XKDMA%40mail.gmail.com.
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/25AD37B8-47D1-49CD-A1A1-D8097F13570F%40wdstudio.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedMar 24, '16 at 9:49p
activeMar 27, '16 at 11:55a
posts11
users5
websiterubyonrails.org
irc#RubyOnRails

People

Translate

site design / logo © 2022 Grokbase