Custom Primary Key (id) on rx.Model after upgrading to > 0.9.0 #6408
kamilhepner
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone,
I was reviewing the changelog for version 0.9.0 and noticed that the id field is no longer silently dropped when defining a custom primary key. https://github.com/reflex-dev/reflex/releases/tag/v0.9.0
If I understand this correctly, would the following code no longer work as expected?
If that’s the case, could someone share an example of how to properly define a custom primary key using the new approach?
Also, out of curiosity to learn: what was the reasoning behind this change? Previously, if a user defines a custom primary key, he assumes that field would be removed automatically, It seems intuitive to drop the id field when a custom primary key is defined. Is that assumption incorrect?
Thanks in advance for the help!
Beta Was this translation helpful? Give feedback.
All reactions