Sha256: 0cb6df28bf97a961b1ac940bd3e20ab49eb3cd5a7e462ca61dce464371c541eb

Contents?: true

Size: 1.17 KB

Versions: 24

Compression:

Stored size: 1.17 KB

Contents

# frozen_string_literal: true

describe 'Ridgepole::Client#diff -> migrate' do
  context 'when table already defined' do
    let(:dsl) do
      <<-RUBY
        create_table "employees", primary_key: "emp_no", force: :cascade do |t|
          t.date    "birth_date", null: false
          t.string  "first_name", limit: 14, null: false
          t.string  "last_name", limit: 16, null: false
          t.string  "gender", limit: 1, null: false
          t.date    "hire_date", null: false
          t.integer "age", unsigned: true, null: false
          t.date    "updated_at"
        end

        create_table "employees", primary_key: "emp_no", force: :cascade do |t|
          t.date    "birth_date", null: false
          t.string  "first_name", limit: 14, null: false
          t.string  "last_name", limit: 16, null: false
          t.string  "gender", limit: 1, null: false
          t.date    "hire_date", null: false
          t.integer "age", unsigned: true, null: false
          t.date    "updated_at"
        end
      RUBY
    end

    subject { client }

    it {
      expect do
        subject.diff(dsl)
      end.to raise_error('Table `employees` already defined')
    }
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
ridgepole-0.9.5 spec/mysql/migrate/migrate_duplicate_table_spec.rb
ridgepole-0.9.4 spec/mysql/migrate/migrate_duplicate_table_spec.rb
ridgepole-0.9.3 spec/mysql/migrate/migrate_duplicate_table_spec.rb
ridgepole-0.9.2 spec/mysql/migrate/migrate_duplicate_table_spec.rb
ridgepole-0.9.1 spec/mysql/migrate/migrate_duplicate_table_spec.rb
ridgepole-0.9.0 spec/mysql/migrate/migrate_duplicate_table_spec.rb
ridgepole-0.8.13 spec/mysql/migrate/migrate_duplicate_table_spec.rb
ridgepole-0.9.0.rc1 spec/mysql/migrate/migrate_duplicate_table_spec.rb
ridgepole-0.9.0.beta spec/mysql/migrate/migrate_duplicate_table_spec.rb
ridgepole-0.8.12 spec/mysql/migrate/migrate_duplicate_table_spec.rb
ridgepole-0.8.11 spec/mysql/migrate/migrate_duplicate_table_spec.rb
ridgepole-0.8.10 spec/mysql/migrate/migrate_duplicate_table_spec.rb
ridgepole-0.8.9 spec/mysql/migrate/migrate_duplicate_table_spec.rb
ridgepole-0.8.8 spec/mysql/migrate/migrate_duplicate_table_spec.rb
ridgepole-0.8.7 spec/mysql/migrate/migrate_duplicate_table_spec.rb
ridgepole-0.8.6 spec/mysql/migrate/migrate_duplicate_table_spec.rb
ridgepole-0.8.5 spec/mysql/migrate/migrate_duplicate_table_spec.rb
ridgepole-0.8.4 spec/mysql/migrate/migrate_duplicate_table_spec.rb
ridgepole-0.8.3 spec/mysql/migrate/migrate_duplicate_table_spec.rb
ridgepole-0.8.2 spec/mysql/migrate/migrate_duplicate_table_spec.rb