Skip to content

Conversation

@alexhouse
Copy link

We're currently using Revisionable in a project that has Uuids for primary keys. Without this change, the IDs keep getting cast to integers, which don't work

@lloy0076
Copy link

It seems the primary key goes into the revisionable_id column in the revisions table - and this is hard coded to be an integer(11).

I'm not sure the best way to handle primary keys that don't happen to be automatically generated integers or whatever type that is assumed; some concerns including:

  • Downgrading UUIDs to a string and then saving as an integer isn't likely to work properly (imho);
  • The things I'm working with are all unique, primary and they're not convertible to an integer without hashing.

I guess it might be possible to have a somewhat large column (a text/a blob) to store the original primary key {stringified or otherwise encoded] and then hash the that to make the primary key (but this presumes a world where secure hashes don't have collisions).

@joshbrw
Copy link

joshbrw commented Mar 17, 2017

Hi all, I'm going to be maintaining a fork that has complete UUID support at https://github.com/joshbrw/revisionable-uuid.

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.

3 participants