class ActiveRecord::ConnectionAdapters::SQLServer::TableDefinition

Public Instance Methods

new_column_definition(name, type, **options) click to toggle source
Calls superclass method
# File lib/active_record/connection_adapters/sqlserver/table_definition.rb, line 102
def new_column_definition(name, type, **options)
  case type
  when :datetime, :timestamp
    # If no precision then default it to 6.
    options[:precision] = 6 unless options.key?(:precision)

    # If there is precision then column must be of type 'datetime2'.
    type = :datetime2 unless options[:precision].nil?
  when :primary_key
    options[:is_identity] = true
  end

  super
end

Private Instance Methods

valid_column_definition_options() click to toggle source
Calls superclass method
# File lib/active_record/connection_adapters/sqlserver/table_definition.rb, line 119
def valid_column_definition_options
  super + [:is_identity]
end