Skip to content

UUIDTools::UUID serializing to binary #82

Open
@Sudrien

Description

@Sudrien

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?

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions