Class: ActiveRecord::Migration
見辛いので箇条書きに。
add_column(table_name, column_name, type, options): Adds a new column to the table called table_name named column_name specified to be one of the following types: :string, :text, :integer, :float, :decimal, :datetime, :timestamp, :time, :date, :binary, :boolean. A default value can be specified by passing an options hash like { :default => 11 }. Other options include :limit and :null (e.g. { :limit => 50, :null => false }) — see ActiveRecord::ConnectionAdapters::TableDefinition#column for details.
見辛いので箇条書きに。
- :types => :string, :text, :integer, :float,
:decimal, :datetime, :timestamp, :time, :date, :binary, :booleanのいづれか - :default => 初期値
- :limit => 文字数(バイト数?)
- :null => true or false
0 件のコメント:
コメントを投稿