当您执行./bin/rails action_text:install时,在Rails中的create_table方法中对大小的渴望是什么意思?

时间:2019-03-08 18:47:58

标签: ruby-on-rails

我用./bin/rails action_text:install创建了一个如下表,然后,我看到了如下迁移文件。 但是,我看不出长的尺寸意味着什么。

# 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

0 个答案:

没有答案