Class: ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::TableDefinition
- Inherits:
-
TableDefinition
- Object
- TableDefinition
- ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::TableDefinition
- Includes:
- ColumnMethods
- Defined in:
- lib/arjdbc/postgresql/adapter.rb
Instance Method Summary collapse
-
#column(name, type = nil, options = {}) ⇒ Object
3.2 super expects (name).
- #primary_key(name, type = :primary_key, options = {}) ⇒ Object
Methods included from ColumnMethods
#bit, #bit_varying, #cidr, #daterange, #hstore, #inet, #int4range, #int8range, #json, #jsonb, #ltree, #macaddr, #numrange, #tsrange, #tstzrange, #tsvector, #uuid, #xml
Instance Method Details
#column(name, type = nil, options = {}) ⇒ Object
3.2 super expects (name)
1443 1444 1445 1446 1447 1448 1449 1450 1451 |
# File 'lib/arjdbc/postgresql/adapter.rb', line 1443 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
1436 1437 1438 1439 1440 1441 |
# File 'lib/arjdbc/postgresql/adapter.rb', line 1436 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 |