mysql-binuuid-rails
mysql-binuuid-rails copied to clipboard
Store UUIDs in binary MySQL database columns. Saves storage, and increases performance.
Let's ensure compatibility with the latest version of Rails.
I have 3 tables ``` class User < ActiveRecord::Base attribute :id, MySQLBinUUID::Type.new has_many :locations_users has_and_belongs_to_many :locations end class Location < ActiveRecord::Base end class LocationsUser < ActiveRecord::Base attribute :user_id, MySQLBinUUID::Type.new belongs_to...
We need to unpack the binary when AR reads it from the database. That is the purpose of the method `deserialize`. That way, the cast method does not need to...
This PR closes #58 by always downcasing string UUID representations. This resolves any possible case inconsistencies between UUIDs supplied by the user and those loaded from the database. This is...
Reloading relations appears to reassign the in-memory parent record ID to the related records' in-memory foreign keys. Additionally, UUIDs are case-insensitive, but are always surfaced to/by ActiveRecord as lowercase. Consequently,...
When we have nil for a foreign key, Rails converts it to an empty string before assigning the attributes to the model and hence it sends an empty string for...
Increases support for temporary tables and join tables. We experienced for example bugs with pagy (gem) since it sends the value ASCII_8BIT encoded.
This brings closer parity to how PostgreSQL handles UUIDs.