Class: ActiveRecord::ConnectionAdapters::MSSQL::TableDefinition

Inherits:
TableDefinition
  • Object
show all
Includes:
ColumnMethods
Defined in:
lib/arjdbc/mssql/schema_definitions.rb

Instance Method Summary collapse

Methods included from ColumnMethods

#binary_basic, #char, #datetime_basic, #money, #nchar, #ntext, #primary_key, #real, #smalldatetime, #smallmoney, #text_basic, #uuid, #varbinary, #varchar, #varchar_max

Instance Method Details

#new_column_definition(name, type, **options) ⇒ Object



78
79
80
81
82
83
84
85
# File 'lib/arjdbc/mssql/schema_definitions.rb', line 78

def new_column_definition(name, type, **options)
  case type
  when :primary_key
    options[:is_identity] = true
  end

  super
end

#timestamps(**options) ⇒ Object



87
88
89
90
91
92
93
# File 'lib/arjdbc/mssql/schema_definitions.rb', line 87

def timestamps(**options)
  if !options.key?(:precision) && @conn.supports_datetime_with_precision?
    options[:precision] = 7
  end

  super
end