class FixPhotosFieldLengths < ActiveRecord::Migration[5.2]
  def up
    change_column :photos, :image_file_name, :text
    change_column :photos, :direct_upload_url, :text
  end

  def down
    change_column :photos, :image_file_name, :string
    change_column :photos, :direct_upload_url, :string
  end
end

Change Photo db fields from string to text
Change Photo db fields from string to text

User-uploaded images have varying lengths, and in the case of storing
the direct_upload_url sometimes that URL can exceed the 255 character
limit default for a string. Since Postgres will treat strings and
varchars the same internally, let's just remove the length limit
completely.
