Class: ActiveRecord::ConnectionAdapters::Redshift::TableDefinition
- Inherits:
-
PostgreSQL::TableDefinition
- Object
- PostgreSQL::TableDefinition
- ActiveRecord::ConnectionAdapters::Redshift::TableDefinition
- Includes:
- PostgreSQL::ColumnMethods
- Defined in:
- lib/active_record/connection_adapters/redshift/schema_definitions.rb,
lib/active_record/connection_adapters/redshift/schema_definitions.rb
Instance Method Summary collapse
-
#new_column_definition(name, type, options) ⇒ Object
:nodoc:.
- #primary_key(name, type = :primary_key, **options) ⇒ Object
Instance Method Details
#new_column_definition(name, type, options) ⇒ Object
:nodoc:
19 20 21 22 23 |
# File 'lib/active_record/connection_adapters/redshift/schema_definitions.rb', line 19 def new_column_definition(name, type, ) # :nodoc: super.tap do |column| column.encoding = [:encoding] end end |
#primary_key(name, type = :primary_key, **options) ⇒ Object
33 34 35 36 37 38 |
# File 'lib/active_record/connection_adapters/redshift/schema_definitions.rb', line 33 def primary_key(name, type=:primary_key, **) ints = %i(integer bigint) [:auto_increment] ||= true if ints.include?(type) && !.key?(:default) type = :primary_key if ints.include?(type) && .delete(:auto_increment) == true super end |