Sha256: 8ca4ae527b3a6744d71c8ad610d9bbe19fe89e39fb56d193213e5ed1efe5c3b7

Contents?: true

Size: 1.08 KB

Versions: 17

Compression:

Stored size: 1.08 KB

Contents

# frozen_string_literal: true

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

    let(:expected_dsl) do
      <<-RUBY
        create_table "books", force: :cascade do |t|
          t.string  "title"
          t.index ["title"], name: "index_books_on_title"
        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

17 entries across 17 versions & 1 rubygems

Version Path
ridgepole-0.8.13 spec/mysql57/virtual/drop_virtual_column_spec.rb
ridgepole-0.9.0.beta spec/mysql57/virtual/drop_virtual_column_spec.rb
ridgepole-0.8.12 spec/mysql57/virtual/drop_virtual_column_spec.rb
ridgepole-0.8.11 spec/mysql57/virtual/drop_virtual_column_spec.rb
ridgepole-0.8.10 spec/mysql57/virtual/drop_virtual_column_spec.rb
ridgepole-0.8.9 spec/mysql57/virtual/drop_virtual_column_spec.rb
ridgepole-0.8.8 spec/mysql57/virtual/drop_virtual_column_spec.rb
ridgepole-0.8.7 spec/mysql57/virtual/drop_virtual_column_spec.rb
ridgepole-0.8.6 spec/mysql57/virtual/drop_virtual_column_spec.rb
ridgepole-0.8.5 spec/mysql57/virtual/drop_virtual_column_spec.rb
ridgepole-0.8.4 spec/mysql57/virtual/drop_virtual_column_spec.rb
ridgepole-0.8.3 spec/mysql57/virtual/drop_virtual_column_spec.rb
ridgepole-0.8.2 spec/mysql57/virtual/drop_virtual_column_spec.rb
ridgepole-0.8.1 spec/mysql57/virtual/drop_virtual_column_spec.rb
ridgepole-0.8.0 spec/mysql57/virtual/drop_virtual_column_spec.rb
ridgepole-0.8.0.rc2 spec/mysql57/virtual/drop_virtual_column_spec.rb
ridgepole-0.7.8 spec/mysql57/virtual/drop_virtual_column_spec.rb