title: Rails - How to add a BLOB column using ActiveRecord?
body: <p>I need to create a BLOB column to store some text content.</p>
  
  <p>I have read somewhere that I need to do the following:</p>
  
  <pre><code>class AddVersionCommentToMetaData &lt; ActiveRecord::Migration
    def self.up
      add_column :meta_data, :version_comment, :binary, :limit =&gt; 10.megabyte
    end
  
    def self.down
      remove_column :meta_data, :version_comment
    end
  end
  </code></pre>
  
  <p>However, it gives the following error message:</p>
  
  <blockquote>
    <p>PGError: ERROR:  type modifier is not allowed for type "bytea" LINE 1:
    ..."meta_data" ADD COLUMN "version_comment_extended" bytea(1048...
                                                                 ^ : ALTER
    TABLE "meta_data" ADD COLUMN "version_comment_extended"
    bytea(10485760)</p>
  </blockquote>
  
  <p>Any idea?</p>
  
  <p>Please note that I am using PostgreSQL.
  Thanks!</p>