0

I created a table like below by ./bin/rails action_text:install and then, I can see the migration file like below. However, I couldn't see what the long means for size.

# This migration comes from action_text (originally 20180528164100)
class CreateActionTextTables < ActiveRecord::Migration[6.0]
  def change
    create_table :action_text_rich_texts do |t|
      t.string     :name, null: false
      t.text       :body, size: :long
      t.references :record, null: false, polymorphic: true, index: false

      t.timestamps

      t.index [ :record_type, :record_id, :name ], name: "index_action_text_rich_texts_uniqueness", unique: true
    end
  end
end
diveintohacking
  • 4,783
  • 6
  • 29
  • 43
  • This answer should help: https://stackoverflow.com/questions/4443477/rails-3-migration-with-longtext – MrYoshiji Mar 08 '19 at 19:33
  • long refers to the memory that is allocated for the `body` field. the actual memory allocated will depend, surely, on the database you are using - that figure may vary between database implementations. – BenKoshy Mar 09 '19 at 05:10

0 Answers0