-
Notifications
You must be signed in to change notification settings - Fork 13
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
Provide UuidMixin for consistent use of UUIDs as non-primary keys #123
Comments
jace
added a commit
to hasgeek/hasjob
that referenced
this issue
Jun 20, 2017
This will need revisiting with hasgeek/coaster#123 though.
jace
added a commit
that referenced
this issue
Jun 20, 2017
The implementation in #124 uses |
Closed
jace
added a commit
that referenced
this issue
Jun 28, 2017
jace
added a commit
that referenced
this issue
Jun 28, 2017
jace
added a commit
to hasgeek/lastuser
that referenced
this issue
Jun 28, 2017
For compliance with hasgeek/coaster#123
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Several of our apps have evolved use of UUIDs, but in their own ways:
userid
column, also standardising on URL-safe Base64 encoding, henceforth known as thebuid
encoding.userid
column in its mixins.buid
encoding in a column nameduuid
.buid
encoding in a column namedbuid
.name
.uuid
.These varied usages need to be standardised. While
IdMixin
introduced support for UUID primary keys in 1d2d315, we have many cases where the app is not ready to migrate to UUIDs for primary keys, and only needs them for secondary (but unique) keys.Following the lessons from #112, #114 and #121, we could introduce a
UuidMixin
that offers a standard interface:uuid
column that stores a native UUID and auto-generates it on first access (as in Auto-set UUID on first access #112 forIdMixin
).buid
hybrid attribute that proxies to the native UUID storage (as in Move url_id from BaseIdNameMixin to BaseMixin or IdMixin #114).suuid
hybrid attribute that does likewise (as in Add buid and suuid hybrid attributes and update url_name #121).url_id
hybrid attribute (as in Move url_id from BaseIdNameMixin to BaseMixin or IdMixin #114).The hybrid attributes in this
UuidMixin
will clash with the ones provided byIdMixin
in #121. The assumptions for use therefore are:UuidMixin
gives it priority by using theUuidMixin, BaseMixin, db.Model
order for base classes.The text was updated successfully, but these errors were encountered: