Sha256: e23d36ba68842c00de0c3d20c50013605c60e8f442c9a324361e52d90f164782

Contents?: true

Size: 1.12 KB

Versions: 3

Compression:

Stored size: 1.12 KB

Contents

describe 'Ridgepole::Client (with integer pk)', condition: 5.1 do
  context 'when with id:integer' do
    let(:dsl) {
      <<-EOS
        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
      EOS
    }

    subject { client }

    before { subject.diff(dsl).migrate }

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

  context 'when without id:integer' do
    let(:dsl) {
      <<-EOS
        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
      EOS
    }

    subject { client }

    before { subject.diff(dsl).migrate }

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ridgepole-0.7.3.beta spec/mysql/bigint_pk/int_pk_spec.rb
ridgepole-0.7.2 spec/mysql/bigint_pk/int_pk_spec.rb
ridgepole-0.7.2.beta spec/mysql/bigint_pk/int_pk_spec.rb