Class: Mkxms::Mssql::Schema
- Inherits:
-
Object
- Object
- Mkxms::Mssql::Schema
- Includes:
- ExtendedProperties, Property::Hosting
- Defined in:
- lib/mkxms/mssql/schema_handler.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#owner ⇒ Object
Returns the value of attribute owner.
Instance Method Summary collapse
-
#initialize(name, owner: nil) ⇒ Schema
constructor
A new instance of Schema.
- #property_subject_identifiers ⇒ Object
- #to_sql ⇒ Object
Methods included from ExtendedProperties
Methods included from Property::Hosting
Constructor Details
#initialize(name, owner: nil) ⇒ Schema
Returns a new instance of Schema.
9 10 11 12 |
# File 'lib/mkxms/mssql/schema_handler.rb', line 9 def initialize(name, owner: nil) @name = name @owner = owner end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
14 15 16 |
# File 'lib/mkxms/mssql/schema_handler.rb', line 14 def name @name end |
#owner ⇒ Object
Returns the value of attribute owner.
14 15 16 |
# File 'lib/mkxms/mssql/schema_handler.rb', line 14 def owner @owner end |
Instance Method Details
#property_subject_identifiers ⇒ Object
24 25 26 |
# File 'lib/mkxms/mssql/schema_handler.rb', line 24 def property_subject_identifiers ['SCHEMA', Utils.unquoted_name(name)] end |
#to_sql ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/mkxms/mssql/schema_handler.rb', line 16 def to_sql if owner "CREATE SCHEMA #{name} AUTHORIZATION #{owner};" else "CREATE SCHEMA #{name};" end + extended_properties_sql.joined_on_new_lines end |