class ActiveRecord::ConnectionAdapters::ColumnDefinition
:nodoc:
for generating a number of table creation or table changing SQL statements.columns
attribute of said TableDefinition object, in order to be used
are typically created by methods in TableDefinition, and added to the
Abstract representation of a column definition. Instances of this type
def add_column_options!(sql, options)
def add_column_options!(sql, options) base.add_column_options!(sql, options.merge(:column => self)) end
def sql_type
def sql_type base.type_to_sql(type.to_sym, limit, precision, scale) rescue type end
def to_sql
def to_sql column_sql = "#{base.quote_column_name(name)} #{sql_type}" column_options = {} column_options[:null] = null unless null.nil? column_options[:default] = default unless default.nil? add_column_options!(column_sql, column_options) unless type.to_sym == :primary_key column_sql end