Sha256: 33e2e1a43ef9ec400bf140998fcede1d0a1d7a8db393917c561c295bba453b48

Contents?: true

Size: 1.24 KB

Versions: 6

Compression:

Stored size: 1.24 KB

Contents

if mysql_awesome_enabled?
  describe 'Ridgepole::Client (with bigint pk)' do
    let(:dsl1) {
      <<-RUBY
        create_table "books", id: :primary_key, limit: 8, force: true do |t|
          t.string   "title",      null: false
          t.integer  "author_id",  null: false
          t.datetime "created_at"
          t.datetime "updated_at"
        end
      RUBY
    }

    let(:dsl2) {
      <<-RUBY
        create_table "books", id: :bigint, force: true do |t|
          t.string   "title",      null: false
          t.integer  "author_id",  null: false
          t.datetime "created_at"
          t.datetime "updated_at"
        end
      RUBY
    }

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

      before { subject.diff(dsl1).migrate }

      it {
        expect(show_create_table(:books)).to include '`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT'
        expect(subject.dump).to eq dsl2.strip_heredoc.strip
      }
    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) unsigned NOT NULL AUTO_INCREMENT'
        expect(subject.dump).to eq dsl2.strip_heredoc.strip
      }
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ridgepole-0.5.3.beta4 spec/bigint_pk/bigint_pkspec.rb
ridgepole-0.5.3.beta2 spec/bigint_pk/bigint_pkspec.rb
ridgepole-0.5.3.beta spec/bigint_pk/bigint_pkspec.rb
ridgepole-0.5.2 spec/bigint_pk/bigint_pkspec.rb
ridgepole-0.5.2.beta6 spec/bigint_pk/bigint_pkspec.rb
ridgepole-0.5.2.beta5 spec/bigint_pk/bigint_pkspec.rb