Class: ActiveRecord::ConnectionAdapters::Redshift::SchemaCreation
- Inherits:
-
PostgreSQL::SchemaCreation
- Object
- PostgreSQL::SchemaCreation
- ActiveRecord::ConnectionAdapters::Redshift::SchemaCreation
- Defined in:
- lib/active_record/connection_adapters/redshift/schema_statements.rb
Constant Summary collapse
- ENCODING_TYPES =
%w[RAW BYTEDICT DELTA DELTA32K LZO MOSTLY8 MOSTLY16 MOSTLY32 RUNLENGTH TEXT255 TEXT32K]
Instance Method Summary collapse
Instance Method Details
#add_column_options!(sql, options) ⇒ Object
Support
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/active_record/connection_adapters/redshift/schema_statements.rb', line 27 def (sql, ) if [:distkey] sql << ' DISTKEY' end if [:sortkey] sql << ' SORTKEY' end if [:encode] sql << " ENCODE #{[:encode]}" end super end |
#column_options(o) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/active_record/connection_adapters/redshift/schema_statements.rb', line 7 def (o) = super [:distkey] = o.distkey [:sortkey] = o.sortkey if o.encode encode = o.encode.to_s.upcase if ENCODING_TYPES.include?(encode) [:encode] = encode else raise "Invalid encoding type: #{o.encode}" end else # column_options[:encode] = 'RAW' end end |