i get the error
PGError: ERROR: type modifier is not allowed for type "text"
LINE 1: ...ng(255), "desc" character varying(255), "content" text(255),...
when i do a heroku run rake db:reset
i understand that postgresql needs an unlimited type for ‘text’ and in my latest migration file i have…
class ChangeLessonsTable < ActiveRecord::Migration
def change
change_table :lessons do |t|
t.change :content, :text, :limit => nil
end
end
end
i still keep getting the error though. any ideas why? i ran rake db:reset, rake db:migrate, and git push to make sure my local db changed. then i ran git heroku push and heroku run rake db:reset but i keep getting that error. am i missing something? thanks
You should be able to leave off the
:limitentirely:If that doesn’t work then you could try separate up and down actions:
As an aside, if you’re targeting PostgreSQL you should just use
:textand forget about the:string(AKAvarchar) column type, PostgreSQL treats them all the same internally. The only time you should bother with varchar/:stringis when your data integrity requires a specific upper limit on the string size.