Class: ActiveRecord::ConnectionAdapters::Hanaclient::TableDefinition
- Inherits:
-
TableDefinition
- Object
- TableDefinition
- ActiveRecord::ConnectionAdapters::Hanaclient::TableDefinition
- Includes:
- ColumnMethods
- Defined in:
- lib/active_record/connection_adapters/hanaclient/schema_definitions.rb
Instance Attribute Summary collapse
-
#as ⇒ Object
readonly
Returns the value of attribute as.
-
#comment ⇒ Object
readonly
Returns the value of attribute comment.
-
#foreign_keys ⇒ Object
readonly
Returns the value of attribute foreign_keys.
-
#indexes ⇒ Object
Returns the value of attribute indexes.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#row_table ⇒ Object
readonly
Returns the value of attribute row_table.
-
#temporary ⇒ Object
readonly
Returns the value of attribute temporary.
Instance Method Summary collapse
-
#initialize(name, temporary = false, row_table = false, options = nil, as = nil, comment: nil) ⇒ TableDefinition
constructor
A new instance of TableDefinition.
- #new_column_definition(name, type, **options) ⇒ Object
Methods included from ColumnMethods
Constructor Details
#initialize(name, temporary = false, row_table = false, options = nil, as = nil, comment: nil) ⇒ TableDefinition
42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/active_record/connection_adapters/hanaclient/schema_definitions.rb', line 42 def initialize(name, temporary = false, row_table = false, = nil, as = nil, comment: nil) @columns_hash = {} @indexes = [] @foreign_keys = [] @primary_keys = nil @row_table = row_table @temporary = temporary = @as = as @name = name @comment = comment end |
Instance Attribute Details
#as ⇒ Object (readonly)
Returns the value of attribute as.
40 41 42 |
# File 'lib/active_record/connection_adapters/hanaclient/schema_definitions.rb', line 40 def as @as end |
#comment ⇒ Object (readonly)
Returns the value of attribute comment.
40 41 42 |
# File 'lib/active_record/connection_adapters/hanaclient/schema_definitions.rb', line 40 def comment @comment end |
#foreign_keys ⇒ Object (readonly)
Returns the value of attribute foreign_keys.
40 41 42 |
# File 'lib/active_record/connection_adapters/hanaclient/schema_definitions.rb', line 40 def foreign_keys @foreign_keys end |
#indexes ⇒ Object
Returns the value of attribute indexes.
39 40 41 |
# File 'lib/active_record/connection_adapters/hanaclient/schema_definitions.rb', line 39 def indexes @indexes end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
40 41 42 |
# File 'lib/active_record/connection_adapters/hanaclient/schema_definitions.rb', line 40 def name @name end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
40 41 42 |
# File 'lib/active_record/connection_adapters/hanaclient/schema_definitions.rb', line 40 def end |
#row_table ⇒ Object (readonly)
Returns the value of attribute row_table.
40 41 42 |
# File 'lib/active_record/connection_adapters/hanaclient/schema_definitions.rb', line 40 def row_table @row_table end |
#temporary ⇒ Object (readonly)
Returns the value of attribute temporary.
40 41 42 |
# File 'lib/active_record/connection_adapters/hanaclient/schema_definitions.rb', line 40 def temporary @temporary end |
Instance Method Details
#new_column_definition(name, type, **options) ⇒ Object
56 57 58 59 60 61 62 63 64 |
# File 'lib/active_record/connection_adapters/hanaclient/schema_definitions.rb', line 56 def new_column_definition(name, type, **) if type == :primary_key type = :integer [:limit] ||= 8 [:auto_increment] = true [:primary_key] = true end super end |