method
column_exists?
v6.1.7.7 -
Show latest stable
- Class:
ActiveRecord::ConnectionAdapters::ColumnMethods::Table
column_exists?(column_name, type = nil, **options)public
Checks to see if a column exists.
t.string(:name) unless t.column_exists?(:name, :string)
See {connection.column_exists?}[rdoc-ref:SchemaStatements#column_exists?]