Sha256: 66e679988678a782ee025f3a54c89efcaa8f33d72bc833cc44b8bd2a2ebb752e

Contents?: true

Size: 1.03 KB

Versions: 24

Compression:

Stored size: 1.03 KB

Contents

# frozen_string_literal: true

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

    let(:expected_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
      RUBY
    end

    before { subject.diff(actual_dsl).migrate }
    subject { client }

    it {
      delta = subject.diff(expected_dsl)
      expect(delta.differ?).to be_truthy
      expect(subject.dump).to match_ruby actual_dsl
      delta.migrate
      expect(subject.dump).to match_ruby expected_dsl
    }
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

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