Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8979271
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T19:48:44+00:00 2026-06-15T19:48:44+00:00

I am trying to setup a Rails app on Heroku using PG, and also

  • 0

I am trying to setup a Rails app on Heroku using PG, and also using devise and oauth to interact with the Yahoo Sports api.

I am running into an issue where when the users goes to authenticate the Heroku logs are telling me:

ActiveRecord::StatementInvalid (PG::Error: ERROR:  value too long for type character varying(255)

So after reading this Stack Overflow post PostgreSQL string(255) limit – Rails, Ruby and Heroku, I tried changing the token to text from string since that seemed to be the longest thing that may be causing the over 255 limit. My migration looked like this:

class AddAccessTokenToAuthentications < ActiveRecord::Migration
  def change
    add_column :authentications, :token, :text, :limit => nil
    add_column :authentications, :secret, :string
  end
 end

However for some reason it seems to be changing everything to text. When I look at my schema after migrating it shows:

create_table "authentications", :force => true do |t|
  t.integer  "user_id"
  t.text     "provider",   :limit => 255
  t.text     "uid",        :limit => 255
  t.datetime "created_at",                :null => false
  t.datetime "updated_at",                :null => false
  t.text     "token",      :limit => 255
  t.text     "secret",     :limit => 255
 end

When I push to Heroku and try to migrate on Heroku I am getting this error:

   -- create_table("authentications", {:force=>true})
     NOTICE:  CREATE TABLE will create implicit sequence "authentications_id_seq" for serial column "authentications.id"
   rake aborted!
   PG::Error: ERROR:  type modifier is not allowed for type "text"
   LINE 1: ...serial primary key, "user_id" integer, "provider" text(255),...
   : CREATE TABLE "authentications" ("id" serial primary key, "user_id" integer, "provider" text(255), "uid" text(255), "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "token" text(255), "secret" text(255))

I am not sure how to resolve this or what I should be looking into.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T19:48:45+00:00Added an answer on June 15, 2026 at 7:48 pm
    PG::Error: ERROR:  type modifier is not allowed for type "text"
    

    means you can’t use :limit

    What you can do is either:

    t.text "provider" # = varchar(max)
    

    or

    t.string "provider",   :limit => 2147483647 # for max limit based on your db
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a rails app running on Heroku. I am using paperclip for some
I'm trying to setup a subdirectory in my Rails 3.2.3 app to service API
I'm using Rails 3.1, and trying to setup Recaptcha so that it only shows
I'm trying to setup my first Rails3 project and, early on, I'm running into
I create rails app deployed on Heroku. also, exception_notification gem enabled. when it is
I'm trying to setup my Rails app on Linode and I'm at the stage
I'm trying to deploy a Rails app to a CentOS server running Passenger. The
I've been trying to setup my first rails app--I'm okay at stumbling around on
I'm trying to push a Rails app to Heroku, but it's failing when it
All this weekend I have been trying to setup a Rails 3.0.4 app in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.