Module: SchemaPlusPgIndexes::Middleware::Postgresql::Dumper::Indexes
- Defined in:
- lib/schema_plus_pg_indexes/middleware/postgresql/dumper.rb
Instance Method Summary collapse
-
#after(env) ⇒ Object
Dump index extensions.
Instance Method Details
#after(env) ⇒ Object
Dump index extensions
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/schema_plus_pg_indexes/middleware/postgresql/dumper.rb', line 9 def after(env) index_defs = Dumper.get_index_definitions(env, env.table) env.table.indexes.each do |index_dump| index_def = index_defs.find(&its.name == index_dump.name) index_dump.[:case_sensitive] = false unless index_def.case_sensitive? index_dump.[:expression] = index_def.expression if index_def.expression and index_def.case_sensitive? unless index_def.operator_classes.blank? if index_def.columns.uniq.length <= 1 && index_def.operator_classes.values.uniq.length == 1 index_dump.[:operator_class] = index_def.operator_classes.values.first else index_dump.[:operator_class] = index_def.operator_classes end end end end |