Sha256: 5a31ed3111804fe4e6fced514ffa7de8f9fe0478940f16058246e10de5626dcd

Contents?: true

Size: 1.31 KB

Versions: 9

Compression:

Stored size: 1.31 KB

Contents

describe 'Ridgepole::Client#diff -> migrate' do
  context 'when change column ignore comment' do
    let(:actual_dsl) {
      erbh(<<-EOS)
        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
      EOS
    }

    let(:expected_dsl) {
      erbh(<<-EOS)
        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
      EOS
    }

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

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

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
ridgepole-0.7.0.beta18 spec/mysql/migrate/migrate_skip_column_comment_change_spec.rb
ridgepole-0.7.0.beta17 spec/mysql/migrate/migrate_skip_column_comment_change_spec.rb
ridgepole-0.7.0.beta16 spec/mysql/migrate/migrate_skip_column_comment_change_spec.rb
ridgepole-0.7.0.beta15 spec/mysql/migrate/migrate_skip_column_comment_change_spec.rb
ridgepole-0.7.0.beta14 spec/mysql/migrate/migrate_skip_column_comment_change_spec.rb
ridgepole-0.7.0.beta13 spec/mysql/migrate/migrate_skip_column_comment_change_spec.rb
ridgepole-0.7.0.beta12 spec/mysql/migrate/migrate_skip_column_comment_change_spec.rb
ridgepole-0.7.0.beta11 spec/mysql/migrate/migrate_skip_column_comment_change_spec.rb
ridgepole-0.7.0.beta10 spec/mysql/migrate/migrate_skip_column_comment_change_spec.rb