Sha256: 47ef4c4d6616cf471eb4de9ad6e00abface17f34a23273daaa7d10d0f41de7f0

Contents?: true

Size: 697 Bytes

Versions: 11

Compression:

Stored size: 697 Bytes

Contents

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

11 entries across 11 versions & 1 rubygems

Version Path
ridgepole-0.8.0.rc1 spec/mysql/migrate/migrate_duplicate_index_spec.rb
ridgepole-0.7.7 spec/mysql/migrate/migrate_duplicate_index_spec.rb
ridgepole-0.7.6 spec/mysql/migrate/migrate_duplicate_index_spec.rb
ridgepole-0.7.5 spec/mysql/migrate/migrate_duplicate_index_spec.rb
ridgepole-0.7.5.beta3 spec/mysql/migrate/migrate_duplicate_index_spec.rb
ridgepole-0.7.5.beta2 spec/mysql/migrate/migrate_duplicate_index_spec.rb
ridgepole-0.7.5.beta spec/mysql/migrate/migrate_duplicate_index_spec.rb
ridgepole-0.7.4 spec/mysql/migrate/migrate_duplicate_index_spec.rb
ridgepole-0.7.3 spec/mysql/migrate/migrate_duplicate_index_spec.rb
ridgepole-0.7.3.beta3 spec/mysql/migrate/migrate_duplicate_index_spec.rb
ridgepole-0.7.3.beta2 spec/mysql/migrate/migrate_duplicate_index_spec.rb