Sha256: 008c77aa5bcd1ceb87cdefa12120f9cc11e1778c5dfd3b6b0fb70dad9441a3a9

Contents?: true

Size: 1.22 KB

Versions: 35

Compression:

Stored size: 1.22 KB

Contents

describe 'Ridgepole::Client (with bigint pk)', condition: 5.0 do
  let(:id_primary_key_create_table) {
    <<-EOS
      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
    EOS
  }

  let(:id_bigint_create_table) {
    <<-EOS
      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
    EOS
  }

  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

35 entries across 35 versions & 1 rubygems

Version Path
ridgepole-0.7.3.beta spec/mysql/bigint_pk/bigint_pk_spec.rb
ridgepole-0.7.2 spec/mysql/bigint_pk/bigint_pk_spec.rb
ridgepole-0.7.2.beta spec/mysql/bigint_pk/bigint_pk_spec.rb
ridgepole-0.7.1 spec/mysql/bigint_pk/bigint_pk_spec.rb
ridgepole-0.7.1.beta5 spec/mysql/bigint_pk/bigint_pk_spec.rb
ridgepole-0.7.1.beta4 spec/mysql/bigint_pk/bigint_pk_spec.rb
ridgepole-0.7.1.beta3 spec/mysql/bigint_pk/bigint_pk_spec.rb
ridgepole-0.7.1.beta2 spec/mysql/bigint_pk/bigint_pk_spec.rb
ridgepole-0.7.1.beta spec/mysql/bigint_pk/bigint_pk_spec.rb
ridgepole-0.7.0 spec/mysql/bigint_pk/bigint_pk_spec.rb
ridgepole-0.7.0.rc1 spec/mysql/bigint_pk/bigint_pk_spec.rb
ridgepole-0.7.0.beta22 spec/mysql/bigint_pk/bigint_pk_spec.rb
ridgepole-0.7.0.beta21 spec/mysql/bigint_pk/bigint_pk_spec.rb
ridgepole-0.7.0.beta20 spec/mysql/bigint_pk/bigint_pk_spec.rb
ridgepole-0.7.0.beta19 spec/mysql/bigint_pk/bigint_pk_spec.rb
ridgepole-0.7.0.beta18 spec/mysql/bigint_pk/bigint_pk_spec.rb
ridgepole-0.7.0.beta17 spec/mysql/bigint_pk/bigint_pk_spec.rb
ridgepole-0.7.0.beta16 spec/mysql/bigint_pk/bigint_pk_spec.rb
ridgepole-0.7.0.beta15 spec/mysql/bigint_pk/bigint_pk_spec.rb
ridgepole-0.7.0.beta14 spec/mysql/bigint_pk/bigint_pk_spec.rb