Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UUIDTools::UUID serializing to binary #82

Open
Sudrien opened this issue Aug 26, 2015 · 0 comments
Open

UUIDTools::UUID serializing to binary #82

Sudrien opened this issue Aug 26, 2015 · 0 comments

Comments

@Sudrien
Copy link

Sudrien commented Aug 26, 2015

There is a related issue at jashmenn/activeuuid#70 - but as of yet I haven't received any advice on that on that end.

ActiveUUID provides a binary(16) field for databases that don't natively support UUIDs. In my case, MySQL. I'm trying to port to PostgreSQL, which does have support for UUIDs.

When a record looks like this:

#<TagWork id: #<UUID:0x3256dd8 UUID:00110954-44a5-4ce2-b067-3cf26a9ea631>, tag_id: #<UUID:0x3256824 UUID:a8bcfc8b-a94a-4236-97d2-dd18c9911fbd>, work_id: #<UUID:0x3256270 UUID:67e9a1d5-b225-4fef-8ea6-26e6dafccc59>, created_at: "2015-06-01 04:03:09", updated_at: "2015-06-01 04:03:09", deleted_at: nil>

MySQL exports like this:

tag_works:
columns:

  • id
  • tag_id
  • work_id
  • created_at
  • updated_at
  • deleted_at
    records:
    • !binary |-
      ABEJVESlTOKwZzzyap6mMQ==
    • !binary |-
      qLz8i6lKQjaX0t0YyZEfvQ==
    • !binary |-
      Z+mh1bIlT++Opibm2vzMWQ==
    • 2015-06-01 04:03:09.000000000 Z
    • 2015-06-01 04:03:09.000000000 Z
    • false

While PostgreSQL, in my tests, exports using the '00110954-44a5-4ce2-b067-3cf26a9ea631' format.

I've tried patching ActiveUUID, but nothing I've done seems to effect the export - I've assumed I needed to implement UUIDTools::UUID.to_yaml ... or dump, or somthing.

Any suggestions as to what need to be implemented to change the export format?

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

No branches or pull requests

1 participant