Sha256: 70b9b5aa42c83db26f5d3d88c3f43ab956f90d6c0ad526ccadb1b76b9cb50976

Contents?: true

Size: 1.31 KB

Versions: 31

Compression:

Stored size: 1.31 KB

Contents

describe 'Ridgepole::Client#diff -> migrate', condition: 5.1 do
  context 'when change virtual column' do
    let(:actual_dsl) {
      <<-EOS
        create_table "books", force: :cascade do |t|
          t.string   "title"
          t.virtual "upper_title", type: :string, null: false, as: "upper(`title`)"
          t.virtual "title_length", type: :integer, null: false, as: "length(`title`)", stored: true
          t.index ["title"], name: "index_books_on_title"
          t.index ["title_length"], name: "index_books_on_title_length"
        end
      EOS
    }

    let(:expected_dsl) {
      <<-EOS
        create_table "books", force: :cascade do |t|
          t.string   "title"
          t.virtual "upper_title", type: :string, null: false, as: "length(`title`)"
          t.virtual "title_length", type: :integer, null: false, as: "upper(`title`)", stored: true
          t.index ["title"], name: "index_books_on_title"
          t.index ["title_length"], name: "index_books_on_title_length"
        end
      EOS
    }

    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_fuzzy actual_dsl
      delta.migrate
      expect(subject.dump).to match_fuzzy expected_dsl
    }
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
ridgepole-0.7.0.beta10 spec/mysql57/virtual/change_virtual_column_spec.rb
ridgepole-0.7.0.beta9 spec/mysql57/virtual/change_virtual_column_spec.rb
ridgepole-0.7.0.beta8 spec/mysql57/virtual/change_virtual_column_spec.rb
ridgepole-0.7.0.beta7 spec/mysql57/virtual/change_virtual_column_spec.rb
ridgepole-0.7.0.beta6 spec/mysql57/virtual/change_virtual_column_spec.rb
ridgepole-0.7.0.beta5 spec/mysql57/virtual/change_virtual_column_spec.rb
ridgepole-0.7.0.beta4 spec/mysql57/virtual/change_virtual_column_spec.rb
ridgepole-0.7.0.beta3 spec/mysql57/virtual/change_virtual_column_spec.rb
ridgepole-0.7.0.beta2 spec/mysql57/virtual/change_virtual_column_spec.rb
ridgepole-0.7.0.beta spec/mysql57/virtual/change_virtual_column_spec.rb
ridgepole-0.7.0.alpha3 spec/mysql57/virtual/change_virtual_column_spec.rb