Class: Mkxms::Mssql::TableTypeKeyConstraintHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/mkxms/mssql/table_type_handler.rb

Instance Method Summary collapse

Constructor Details

#initialize(constraints, node) ⇒ TableTypeKeyConstraintHandler

Returns a new instance of TableTypeKeyConstraintHandler.



214
215
216
217
218
# File 'lib/mkxms/mssql/table_type_handler.rb', line 214

def initialize(constraints, node)
  TableType::KeyConstraint.new(node.attributes).tap do |c|
    constraints << (@constraint = c)
  end
end

Instance Method Details

#handle_column_element(parse) ⇒ Object



220
221
222
# File 'lib/mkxms/mssql/table_type_handler.rb', line 220

def handle_column_element(parse)
  @constraint.columns << TableType::ConstraintColumn.new(parse.node.attributes)
end

#handle_property_element(parse) ⇒ Object



224
225
226
# File 'lib/mkxms/mssql/table_type_handler.rb', line 224

def handle_property_element(parse)
  raise "Properties on table type constraints are unsupported"
end