Class: Mkxms::Mssql::PrimaryKeyHandler
- Inherits:
-
Object
- Object
- Mkxms::Mssql::PrimaryKeyHandler
- Defined in:
- lib/mkxms/mssql/primary_key_handler.rb
Instance Method Summary collapse
- #extended_properties ⇒ Object
- #handle_column_element(parse) ⇒ Object
-
#initialize(constraints, node) ⇒ PrimaryKeyHandler
constructor
A new instance of PrimaryKeyHandler.
Methods included from Mkxms::Mssql::PropertyHandler::ElementHandler
Constructor Details
#initialize(constraints, node) ⇒ PrimaryKeyHandler
Returns a new instance of PrimaryKeyHandler.
15 16 17 18 19 20 21 |
# File 'lib/mkxms/mssql/primary_key_handler.rb', line 15 def initialize(constraints, node) a = node.attributes @pkey = PrimaryKey.new(a).tap do |c| constraints << c end end |
Instance Method Details
#extended_properties ⇒ Object
23 24 25 |
# File 'lib/mkxms/mssql/primary_key_handler.rb', line 23 def extended_properties @pkey.extended_properties end |
#handle_column_element(parse) ⇒ Object
27 28 29 30 31 32 |
# File 'lib/mkxms/mssql/primary_key_handler.rb', line 27 def handle_column_element(parse) a = parse.node.attributes raise UnsupportedFeatureError.new("Primary keys may not specify included columns (#{@pkey.qualified_table})") if a['included'] @pkey.columns << IndexColumn.new(a['name'], a['desc'] ? :descending : :ascending) end |