Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

UUID are not sequenced, so pk comes back empty when the pk is a uuid. S... #12039

Closed
wants to merge 1 commit into from

2 participants

@Altonymous

...hould check both fields if pk wasn't found in the first one.

@Altonymous Altonymous UUID are not sequenced, so pk comes back empty when the pk is a uuid.…
… Should check both fields if pk wasn't found in the first one.
6dea3e5
@magikid magikid commented on the diff
activerecord/lib/active_record/schema_dumper.rb
@@ -101,7 +101,8 @@ def table(table, stream)
# first dump primary key column
if @connection.respond_to?(:pk_and_sequence_for)
pk, _ = @connection.pk_and_sequence_for(table)
- elsif @connection.respond_to?(:primary_key)
+ end
@magikid
magikid added a note

Why did you end the if statement instead of adding another elsif? I think this may be why your PR breaks the build.

Honestly, I don't remember submitted this over a year ago and even deleted the fork.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@Altonymous Altonymous closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 27, 2013
  1. @Altonymous

    UUID are not sequenced, so pk comes back empty when the pk is a uuid.…

    Altonymous authored
    … Should check both fields if pk wasn't found in the first one.
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 1 deletion.
  1. +2 −1  activerecord/lib/active_record/schema_dumper.rb
View
3  activerecord/lib/active_record/schema_dumper.rb
@@ -101,7 +101,8 @@ def table(table, stream)
# first dump primary key column
if @connection.respond_to?(:pk_and_sequence_for)
pk, _ = @connection.pk_and_sequence_for(table)
- elsif @connection.respond_to?(:primary_key)
+ end
@magikid
magikid added a note

Why did you end the if statement instead of adding another elsif? I think this may be why your PR breaks the build.

Honestly, I don't remember submitted this over a year ago and even deleted the fork.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+ if pk.empty? && @connection.respond_to?(:primary_key)
pk = @connection.primary_key(table)
end
Something went wrong with that request. Please try again.