Class: ActiveRecord::ConnectionAdapters::PostgreSQL::TableDefinition
- Inherits:
-
TableDefinition
- Object
- TableDefinition
- ActiveRecord::ConnectionAdapters::PostgreSQL::TableDefinition
- Defined in:
- lib/arjdbc/postgresql/base/schema_definitions.rb
Instance Method Summary collapse
-
#column(name, type = nil, options = {}) ⇒ Object
3.2 super expects (name).
- #primary_key(name, type = :primary_key, options = {}) ⇒ Object
Instance Method Details
#column(name, type = nil, options = {}) ⇒ Object
3.2 super expects (name)
96 97 98 99 100 101 102 103 104 |
# File 'lib/arjdbc/postgresql/base/schema_definitions.rb', line 96 def column(name, type = nil, = {}) super column = self[name] # NOTE: <= 3.1 no #new_column_definition hard-coded ColumnDef.new : # column = self[name] || ColumnDefinition.new(@base, name, type) # thus we simply do not support array column definitions on <= 3.1 column.array = [:array] if column.is_a?(ColumnDefinition) self end |
#primary_key(name, type = :primary_key, options = {}) ⇒ Object
89 90 91 92 93 94 |
# File 'lib/arjdbc/postgresql/base/schema_definitions.rb', line 89 def primary_key(name, type = :primary_key, = {}) return super unless type == :uuid [:default] = .fetch(:default, 'uuid_generate_v4()') [:primary_key] = true column name, type, end |