Module: SchemaPlus::ActiveRecord::ConnectionAdapters::MysqlAdapter::AddColumnOptions

Defined in:
lib/schema_plus/active_record/connection_adapters/mysql_adapter.rb

Instance Method Summary collapse

Instance Method Details

#default_expr_valid?(expr) ⇒ Boolean

Returns:

  • (Boolean)

186
187
188
# File 'lib/schema_plus/active_record/connection_adapters/mysql_adapter.rb', line 186

def default_expr_valid?(expr)
  false # only the TIMESTAMP column accepts SQL column defaults and rails uses DATETIME
end

#sql_for_function(function) ⇒ Object


190
191
192
193
194
# File 'lib/schema_plus/active_record/connection_adapters/mysql_adapter.rb', line 190

def sql_for_function(function)
  case function
  when :now then 'CURRENT_TIMESTAMP'
  end
end