Module: ActiveRecord::ConnectionAdapters::MSSQL::ColumnMethods

Included in:
Table, TableDefinition
Defined in:
lib/arjdbc/mssql/schema_definitions.rb

Instance Method Summary collapse

Instance Method Details

#binary_basic(*args, **options) ⇒ Object



62
63
64
# File 'lib/arjdbc/mssql/schema_definitions.rb', line 62

def binary_basic(*args, **options)
  args.each { |name| column(name, :binary_basic, **options) }
end

#char(*args, **options) ⇒ Object



38
39
40
# File 'lib/arjdbc/mssql/schema_definitions.rb', line 38

def char(*args, **options)
  args.each { |name| column(name, :char, **options) }
end

#datetime_basic(*args, **options) ⇒ Object

this is the old sql server datetime type, the precision is as follow xx1, xx3, and xx7



22
23
24
# File 'lib/arjdbc/mssql/schema_definitions.rb', line 22

def datetime_basic(*args, **options)
  args.each { |name| column(name, :datetime_basic, **options) }
end

#money(*args, **options) ⇒ Object



30
31
32
# File 'lib/arjdbc/mssql/schema_definitions.rb', line 30

def money(*args, **options)
  args.each { |name| column(name, :money, **options) }
end

#nchar(*args, **options) ⇒ Object



54
55
56
# File 'lib/arjdbc/mssql/schema_definitions.rb', line 54

def nchar(*args, **options)
  args.each { |name| column(name, :nchar, **options) }
end

#ntext(*args, **options) ⇒ Object



58
59
60
# File 'lib/arjdbc/mssql/schema_definitions.rb', line 58

def ntext(*args, **options)
  args.each { |name| column(name, :ntext, **options) }
end

#primary_key(name, type = :primary_key, **options) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/arjdbc/mssql/schema_definitions.rb', line 7

def primary_key(name, type = :primary_key, **options)
  if [:integer, :bigint].include?(type)
    options[:is_identity] = true unless options.key?(:default)
  end

  super
end

#real(*args, **options) ⇒ Object



26
27
28
# File 'lib/arjdbc/mssql/schema_definitions.rb', line 26

def real(*args, **options)
  args.each { |name| column(name, :real, **options) }
end

#smalldatetime(*args, **options) ⇒ Object

datetime with seconds always zero (:00) and without fractional seconds



16
17
18
# File 'lib/arjdbc/mssql/schema_definitions.rb', line 16

def smalldatetime(*args, **options)
  args.each { |name| column(name, :smalldatetime, **options) }
end

#smallmoney(*args, **options) ⇒ Object



34
35
36
# File 'lib/arjdbc/mssql/schema_definitions.rb', line 34

def smallmoney(*args, **options)
  args.each { |name| column(name, :smallmoney, **options) }
end

#text_basic(*args, **options) ⇒ Object



50
51
52
# File 'lib/arjdbc/mssql/schema_definitions.rb', line 50

def text_basic(*args, **options)
  args.each { |name| column(name, :text_basic, **options) }
end

#uuid(*args, **options) ⇒ Object



70
71
72
# File 'lib/arjdbc/mssql/schema_definitions.rb', line 70

def uuid(*args, **options)
  args.each { |name| column(name, :uniqueidentifier, **options) }
end

#varbinary(*args, **options) ⇒ Object



66
67
68
# File 'lib/arjdbc/mssql/schema_definitions.rb', line 66

def varbinary(*args, **options)
  args.each { |name| column(name, :varbinary, **options) }
end

#varchar(*args, **options) ⇒ Object



42
43
44
# File 'lib/arjdbc/mssql/schema_definitions.rb', line 42

def varchar(*args, **options)
  args.each { |name| column(name, :varchar, **options) }
end

#varchar_max(*args, **options) ⇒ Object



46
47
48
# File 'lib/arjdbc/mssql/schema_definitions.rb', line 46

def varchar_max(*args, **options)
  args.each { |name| column(name, :varchar_max, **options) }
end