Sha256: 5cb21ca2a8d467137f27a86ec49970b25249f5179685b3f38a66ce821a6821a2

Contents?: true

Size: 1.26 KB

Versions: 17

Compression:

Stored size: 1.26 KB

Contents

# frozen_string_literal: true

describe 'Ridgepole::Client (with bigint pk)', condition: 5.0 do
  let(:id_primary_key_create_table) do
    <<-RUBY
      create_table "books", id: :primary_key, limit: 8, 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

  let(:id_bigint_create_table) do
    <<-RUBY
      create_table "books", id: :bigint, 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

  context 'when with limit:8' do
    subject { client }

    before { subject.diff(id_primary_key_create_table).migrate }

    it {
      expect(show_create_table(:books)).to include '`id` bigint(20) NOT NULL AUTO_INCREMENT'
      expect(subject.dump).to match_fuzzy id_bigint_create_table
    }
  end

  context 'when with id:bigint' do
    subject { client }

    before { subject.diff(id_bigint_create_table).migrate }

    it {
      expect(show_create_table(:books)).to include '`id` bigint(20) NOT NULL AUTO_INCREMENT'
      expect(subject.dump).to match_fuzzy id_bigint_create_table
    }
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

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