nktokyo
nktokyo

Reputation: 642

Rails text field size limit error - text(255)

I have a rails DB and I noticed some save errors when putting a lot of text into text areas.

I checked and for some reason they've been created as either text or varchar but with limits of 255, here's the viewer from a DB client.

Screenshot

I tried the below migration to see if it would change to text with no limit however it's not had any effect:

change_column :investors, :notes, :text
change_column :investors, :has_property_notes, :text
change_column :investors, :jv_partner_notes, :text

Other text fields don't seem to have this problem. Any suggestions would be greatly appreciated!

Thanks

Nick

Upvotes: 0

Views: 133

Answers (1)

sonnyhe2002
sonnyhe2002

Reputation: 2121

Use limit nil for stubborn databases. Also you should put this in a new migration.

 change_column :investors, :notes, :text, :limit => nil
 change_column :investors, :has_property_notes, :text, :limit => nil
 change_column :investors, :jv_partner_notes, :text, :limit => nil

Upvotes: 2

Related Questions