方法
- C
- P
實例公開方法
column(name, type, **options) 連結
來源:顯示 | 在 GitHub 上
# File activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb, line 319 included do define_column_methods :bigint, :binary, :boolean, :date, :datetime, :decimal, :float, :integer, :json, :string, :text, :time, :timestamp, :virtual alias :blob :binary alias :numeric :decimal end
primary_key(name, type = :primary_key, **options) 連結
附加主索引定義至資料表定義。可反覆呼叫,但並非良策。
來源:顯示 | 在 GitHub 上
# File activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb, line 304 def primary_key(name, type = :primary_key, **options) column(name, type, **options.merge(primary_key: true)) end