Skip to content

Indexing UUIDs that start with Zero#1

Open
maxdemarzi wants to merge 1 commit intonbraem:masterfrom
maxdemarzi:master
Open

Indexing UUIDs that start with Zero#1
maxdemarzi wants to merge 1 commit intonbraem:masterfrom
maxdemarzi:master

Conversation

@maxdemarzi
Copy link
Copy Markdown

I was bulk loading a bunch of records that started with zero ("0f1c7a00-b0c3-11df-bedb-003048c3cf84") and then reindexing them with rake sunspot:solr:reindex . If ALL of the records started with zero the reindex would fail because records.last would be nil and the call to records.last.id would fail.

If only some of the records started with zero, they would get skipped and not indexed.

The change doesn't break integer ids because if integers are being used the string Zero will be converted and compared as a number by the database itself (at least for mysql, postgre, sql server and oracle).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant