Sha256: 6a9d8b0afded89b63a2954683dc4b585d32ba749e7c66a4a41cbe777f6e12e5a

Contents?: true

Size: 728 Bytes

Versions: 24

Compression:

Stored size: 728 Bytes

Contents

# frozen_string_literal: true

describe 'Ridgepole::Client#diff -> migrate' do
  context 'when index already defined' do
    let(:dsl) do
      <<-RUBY
        create_table "salaries", id: false, force: :cascade do |t|
          t.integer "emp_no", null: false
          t.integer "salary", null: false
          t.date    "from_date", null: false
          t.date    "to_date", null: false
        end

        add_index "salaries", ["emp_no"], name: "emp_no", using: :btree
        add_index "salaries", ["emp_no"], name: "emp_no", using: :btree
      RUBY
    end

    subject { client }

    it {
      expect do
        subject.diff(dsl)
      end.to raise_error('Index `salaries(emp_no)` already defined')
    }
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
ridgepole-0.8.1 spec/mysql/migrate/migrate_duplicate_index_spec.rb
ridgepole-0.8.0 spec/mysql/migrate/migrate_duplicate_index_spec.rb
ridgepole-0.8.0.rc2 spec/mysql/migrate/migrate_duplicate_index_spec.rb
ridgepole-0.7.8 spec/mysql/migrate/migrate_duplicate_index_spec.rb