Sha256: 2168c160b610417288c739886f07d382e1869ba1d19628614fc8e40571c5f023

Contents?: true

Size: 1.15 KB

Versions: 11

Compression:

Stored size: 1.15 KB

Contents

describe 'Ridgepole::Client (with integer pk)', condition: '>= 5.1.0' do
  context 'when with id:integer' do
    let(:dsl) do
      <<-RUBY
        create_table "books", id: :integer, force: :cascade do |t|
          t.string   "title", null: false
          t.integer  "author_id", null: false
          t.datetime "created_at"
          t.datetime "updated_at"
        end
      RUBY
    end

    subject { client }

    before { subject.diff(dsl).migrate }

    specify do
      expect(show_create_table(:books)).to include '`id` int(11) NOT NULL AUTO_INCREMENT'
      expect(subject.dump).to match_ruby dsl
    end
  end

  context 'when without id:integer' do
    let(:dsl) do
      <<-RUBY
        create_table "books", force: :cascade do |t|
          t.string   "title", null: false
          t.integer  "author_id", null: false
          t.datetime "created_at"
          t.datetime "updated_at"
        end
      RUBY
    end

    subject { client }

    before { subject.diff(dsl).migrate }

    specify do
      expect(show_create_table(:books)).to include '`id` bigint(20) NOT NULL AUTO_INCREMENT'
      expect(subject.dump).to match_ruby dsl
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

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