Module: TableConstraintNode

Defined in:
lib/sql_munger/nodes.rb

Instance Method Summary collapse

Instance Method Details

#constraint?Boolean

Returns:

  • (Boolean)


211
# File 'lib/sql_munger/nodes.rb', line 211

def constraint?; true; end

#field?Boolean

Returns:

  • (Boolean)


210
# File 'lib/sql_munger/nodes.rb', line 210

def field?; false; end

#fieldsObject



221
222
223
224
225
# File 'lib/sql_munger/nodes.rb', line 221

def fields
  constraint_spec.parenthesised_list.qualified_identifier_list.elements.map do |node|
    node.qualified_identifier.text_value
  end
end

#nameObject



217
218
219
# File 'lib/sql_munger/nodes.rb', line 217

def name
  constraint_name.parts.last
end

#typeObject



213
214
215
# File 'lib/sql_munger/nodes.rb', line 213

def type
  constraint_spec.constraint_clause.text_value.downcase.gsub( /\s+/, '_' ).to_sym
end