About to migrate :string but I'm thinking :text might be better. Performance/Purpose?

Posted by Sam on Stack Overflow See other posts from Stack Overflow or by Sam
Published on 2011-01-08T03:31:36Z Indexed on 2011/01/08 3:54 UTC
Read the original article Hit count: 262

Filed under:
|
|
|
|
class CreateScrapes < ActiveRecord::Migration
  def self.up
    create_table :scrapes do |t|
      t.text :saved_characters
      t.text :sanitized_characters
      t.string :href

      t.timestamps
   end
  end

  def self.down
    drop_table :scrapes
  end
end

I'm about to rake db:migrate and I'm think about the attribute type if I should be using text or string. Since saved_characters and sanitized_characters will be arrays with thousands of unicode values, its basically comma delimited data, I'm not sure if `:text' is really the right way to go here. What would you do?

© Stack Overflow or respective owner

Related posts about sql

Related posts about ruby