Flowdock
method

index_metadata

Importance_0
v1.2.6 - Show latest stable - 0 notes - Class: ActiveRecord::ConnectionAdapters::FirebirdAdapter
index_metadata(table_name, pk, name = nil) private

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activerecord/lib/active_record/connection_adapters/firebird_adapter.rb, line 609
        def index_metadata(table_name, pk, name = nil)
          sql = "SELECT i.rdb$index_name, i.rdb$unique_flag, s.rdb$field_name\nFROM rdb$indices i\nJOIN rdb$index_segments s ON i.rdb$index_name = s.rdb$index_name\nLEFT JOIN rdb$relation_constraints c ON i.rdb$index_name = c.rdb$index_name\nWHERE i.rdb$relation_name = '\#{table_name.to_s.upcase}'\n"
          if pk
            sql << "AND c.rdb$constraint_type = 'PRIMARY KEY'\n"
          else
            sql << "AND (c.rdb$constraint_type IS NULL OR c.rdb$constraint_type != 'PRIMARY KEY')\n"
          end
          sql << "ORDER BY i.rdb$index_name, s.rdb$field_position\n"
          execute sql, name
        end
Register or log in to add new notes.