Class: ActiveRecord::ConnectionAdapters::TypeDefinition
- Inherits:
-
Struct
- Object
- Struct
- ActiveRecord::ConnectionAdapters::TypeDefinition
- Defined in:
- lib/connection_adapters/type_definition.rb
Instance Attribute Summary collapse
-
#columns ⇒ Object
Returns the value of attribute columns.
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
Instance Attribute Details
#columns ⇒ Object
Returns the value of attribute columns
3 4 5 |
# File 'lib/connection_adapters/type_definition.rb', line 3 def columns @columns end |
#id ⇒ Object
Returns the value of attribute id
3 4 5 |
# File 'lib/connection_adapters/type_definition.rb', line 3 def id @id end |
#name ⇒ Object
Returns the value of attribute name
3 4 5 |
# File 'lib/connection_adapters/type_definition.rb', line 3 def name @name end |
Instance Method Details
#to_sql(action = "create", options = {}) ⇒ Object
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/connection_adapters/type_definition.rb', line 5 def to_sql(action="create", ={}) case action when "create", :create "CREATE SCHEMA #{name.to_sql_name} AUTHORIZATION #{owner.to_sql_name}" # TODO - [ schema_element ] when "drop", :drop "DROP SCHEMA #{name.to_sql_name} #{cascade_or_restrict(options[:cascade])}" # TODO - [ IF EXISTS ] end end |