Sha256: ba03c99a4413e10f8ed833489b32991a35ad6ac0ccab41dff6c8f7a7e7e8cfb8

Contents?: true

Size: 1.25 KB

Versions: 18

Compression:

Stored size: 1.25 KB

Contents

describe 'Ridgepole::Client (with bigint pk)', condition: [:mysql_awesome_enabled, :activerecord_5] do
  let(:dsl1) {
    erbh(<<-EOS)
      create_table "books", id: :primary_key, limit: 8, force: :cascade do |t|
        t.string   "title",      <%= i limit(255) + {null: false} %>
        t.integer  "author_id",  <%= i limit(4) + {null: false} %>
        t.datetime "created_at"
        t.datetime "updated_at"
      end
    EOS
  }

  let(:dsl2) {
    erbh(<<-EOS)
      create_table "books", id: :bigint, force: :cascade do |t|
        t.string   "title",      <%= i limit(255) + {null: false} %>
        t.integer  "author_id",  <%= i limit(4) + {null: false} %>
        t.datetime "created_at"
        t.datetime "updated_at"
      end
    EOS
  }

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

    before { subject.diff(dsl1).migrate }

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

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

    before { subject.diff(dsl2).migrate }

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

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
ridgepole-0.6.6 spec/mysql/bigint_pk/bigint_pk_spec.rb
ridgepole-0.6.6.beta3 spec/mysql/bigint_pk/bigint_pk_spec.rb
ridgepole-0.6.6.beta2 spec/mysql/bigint_pk/bigint_pk_spec.rb
ridgepole-0.6.6.beta spec/mysql/bigint_pk/bigint_pk_spec.rb
ridgepole-0.6.5 spec/mysql/bigint_pk/bigint_pk_spec.rb
ridgepole-0.6.5.beta14 spec/mysql/bigint_pk/bigint_pk_spec.rb
ridgepole-0.6.5.beta13 spec/mysql/bigint_pk/bigint_pk_spec.rb
ridgepole-0.6.5.beta12 spec/mysql/bigint_pk/bigint_pk_spec.rb
ridgepole-0.6.5.beta11 spec/mysql/bigint_pk/bigint_pk_spec.rb
ridgepole-0.6.5.beta10 spec/mysql/bigint_pk/bigint_pk_spec.rb
ridgepole-0.6.5.beta9 spec/mysql/bigint_pk/bigint_pk_spec.rb
ridgepole-0.6.5.beta8 spec/mysql/bigint_pk/bigint_pk_spec.rb
ridgepole-0.6.5.beta7 spec/mysql/bigint_pk/bigint_pk_spec.rb
ridgepole-0.6.5.beta6 spec/mysql/bigint_pk/bigint_pk_spec.rb
ridgepole-0.6.5.beta5 spec/mysql/bigint_pk/bigint_pk_spec.rb
ridgepole-0.6.5.beta4 spec/mysql/bigint_pk/bigint_pk_spec.rb
ridgepole-0.6.5.beta3 spec/mysql/bigint_pk/bigint_pk_spec.rb
ridgepole-0.6.5.beta2 spec/mysql/bigint_pk/bigint_pk_spec.rb