Sha256: e22c0ab7785a18edf9d9bbecae85e20db10d476f8c01b67a9c0fa4d84b9f1834

Contents?: true

Size: 1.29 KB

Versions: 11

Compression:

Stored size: 1.29 KB

Contents

describe 'Ridgepole::Client#diff -> migrate' do
  context 'when change column ignore comment' do
    let(:actual_dsl) do
      erbh(<<-ERB)
        create_table "employees", primary_key: "emp_no", force: :cascade do |t|
          t.date   "birth_date", null: false, comment: "my comment"
          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.index ["gender"], name: "gender", <%= i cond(5.0, using: :btree) %>
        end
      ERB
    end

    let(:expected_dsl) do
      erbh(<<-ERB)
        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, comment: "my comment2"
          t.string "last_name", limit: 16, null: false
          t.string "gender", limit: 1, null: false
          t.date   :hire_date, null: false
          t.index :gender, name: :gender, <%= i cond(5.0, using: :btree) %>
        end
      ERB
    end

    before { subject.diff(actual_dsl).migrate }
    subject { client(skip_column_comment_change: true) }

    it {
      delta = subject.diff(expected_dsl)
      expect(delta.differ?).to be_falsey
    }
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

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