Sha256: f1d6b9367493d6ab6b6732a900e82b70c38770b7406a63e6d1c1a014aa95e181

Contents?: true

Size: 794 Bytes

Versions: 1

Compression:

Stored size: 794 Bytes

Contents

require_relative '../spec_helper.rb'

class IndexKing < ::ActiveRecord::Migration[6.1]
  def self.drop_kings
    if table_exists?(:kings)
      drop_table :kings
    end
  end

  def self.up
    create_table :kings do |t|
      t.string :king_name_to_not_have_only_auto_increment_columns
    end
  end

  def self.down
    drop_table :kings
  end
end

# Vertica does not support "indexing" it uses Projections
# and those must be created differently
#
describe IndexKing do
  def connection
    ::ActiveRecord::Base.connection
  end

  before do
    IndexKing.drop_kings
  end

  describe "#index_exists?" do
    it "always says false" do
      connection.index_exists?(:kings, :id).must_equal(false)
      connection.index_exists?(:kings, [ :id, :not_id ]).must_equal(false)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
activerecord-jdbcvertica-adapter-0.6.2.pre1 spec/migrations/index_spec.rb