Skip to content

Using a non primary key column for the id attribute #675

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

Closed
charlieallatson opened this issue Jul 8, 2019 · 1 comment
Closed

Using a non primary key column for the id attribute #675

charlieallatson opened this issue Jul 8, 2019 · 1 comment

Comments

@charlieallatson
Copy link
Contributor

I have a use case where my model has a normal primary key which is an integer but I don't want to expose this value to consumers of the api. Instead I want the id attribute to be a separate column which is a uuid. Is this something this project could support?
My proposal would be to have a meta class defined on the model which tells us to use a different field rather than the primary key.

@sliverc
Copy link
Member

sliverc commented Jul 8, 2019

That is currently not possible and you would have to make the UUID your primary key.

Also see #155 where this issue is being discussed.

Closing this issue as duplicate.

@sliverc sliverc closed this as completed Jul 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants