{"id":15484211,"url":"https://github.com/mathieujobin/activerecord-mysql-uuid-column","last_synced_at":"2025-05-07T13:04:34.038Z","repository":{"id":14815606,"uuid":"77152393","full_name":"mathieujobin/activerecord-mysql-uuid-column","owner":"mathieujobin","description":"Real UUID column for ActiveRecord MySQL adapter","archived":false,"fork":false,"pushed_at":"2022-05-19T02:20:26.000Z","size":46,"stargazers_count":10,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-07T13:04:25.812Z","etag":null,"topics":["activerecord","mysql","rails","ruby","uuid"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mathieujobin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-12-22T14:49:33.000Z","updated_at":"2023-04-10T22:45:58.000Z","dependencies_parsed_at":"2022-07-25T18:02:43.720Z","dependency_job_id":null,"html_url":"https://github.com/mathieujobin/activerecord-mysql-uuid-column","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathieujobin%2Factiverecord-mysql-uuid-column","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathieujobin%2Factiverecord-mysql-uuid-column/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathieujobin%2Factiverecord-mysql-uuid-column/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathieujobin%2Factiverecord-mysql-uuid-column/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mathieujobin","download_url":"https://codeload.github.com/mathieujobin/activerecord-mysql-uuid-column/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252883226,"owners_count":21819158,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["activerecord","mysql","rails","ruby","uuid"],"created_at":"2024-10-02T05:23:36.228Z","updated_at":"2025-05-07T13:04:34.013Z","avatar_url":"https://github.com/mathieujobin.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ActiveRecord::Mysql::UuidColumn\n\nAdds a :uuid column to ActiveRecord MySQL2 Adapter\nit is stored in a 16 bytes binary column. which is exactly the space it needs.\n\n[![Gem Version](https://badge.fury.io/rb/activerecord-mysql-uuid-column.svg)](https://badge.fury.io/rb/activerecord-mysql-uuid-column)\n[![Build Status](https://travis-ci.org/mathieujobin/activerecord-mysql-uuid-column.svg?branch=master)](https://travis-ci.org/mathieujobin/activerecord-mysql-uuid-column)\n![GitHub release](https://img.shields.io/github/release/mathieujobin/activerecord-mysql-uuid-column.svg)\n[![Codecov](https://img.shields.io/codecov/c/github/mathieujobin/activerecord-mysql-uuid-column.svg)](https://codecov.io/gh/mathieujobin/activerecord-mysql-uuid-column)\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'activerecord-mysql-uuid-column'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install activerecord-mysql-uuid-column\n\n## Usage\n\nRegular MySQL ActiveRecord config\n```\ntest:\n  adapter: mysql2\n  username: root\n  host: localhost\n  reconnect: true\n  database: awesome_project_of_yours\n```\n\nAdds column type `uuid`\n\n```\nActiveRecord::Schema.define(version: 20161122225732) do\n  create_table \"workers\", force: true do |t|\n    t.uuid     \"job_uuid\"\n  end\nend\n```\n\nDefine it in your model\n\n```\nclass Worker \u003c ActiveRecord::Base\n  attribute :job_uuid, :uuid\nend\n```\n\nThen use as regular string column, except that it will be stored in a 16 bytes binary column.\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/mathieujobin/activerecord-mysql-uuid-column. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.\n\n## Online API Doc\n* http://www.rubydoc.info/gems/activerecord-mysql-uuid-column/0.2.0\n\n## On libraries.io\n* https://libraries.io/rubygems/activerecord-mysql-uuid-column\n\n## Resources\n* https://christoph.luppri.ch/articles/2017/01/07/adding-custom-types-to-your-activerecord-models-with-the-attributes-api/\n* https://karolgalanciak.com/blog/2016/12/04/introduction-to-activerecord-and-activemodel-attributes-api/\n* https://blog.metova.com/rails-5-attributes-api\n* https://gorails.com/episodes/virtual-attributes-and-rails-5-attribute-api\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathieujobin%2Factiverecord-mysql-uuid-column","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmathieujobin%2Factiverecord-mysql-uuid-column","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathieujobin%2Factiverecord-mysql-uuid-column/lists"}