Change the PK field
See original GitHub issueIs your feature request related to a problem? Please describe.
The PK on the APIKey model is the string containing the prefix and hash. This makes it challenging to work with when referencing it in URLs in many REST-based frameworks. eg. 2TothlA4.pbkdf2_sha256$36000$dfPh6LIy7NB3$FTA61Pvuq3gres5ZsclXimNCRz70jvDRl/ygYOjEiLc=
. This contains a slash and other special chars that would typically be URL encoded.
Describe the solution you’d like Either convert the model to use a standard integer PK or provide some other means to reference it in such a way
Describe alternatives you’ve considered I’m not sure, but could this be handled through the solution being considered for #34?
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Change Primary Key Column in SQL Server - GeeksforGeeks
Syntax: Alter table table_name add primary key (column_name); To change the Primary key column in the SQL Server, follow these steps: Drop ...
Read more >ALTER PRIMARY KEY | CockroachDB Docs
The ALTER PRIMARY KEY statement is a subcommand of ALTER TABLE that can be used to change the primary key of a table....
Read more >Modify Primary Keys - SQL Server | Microsoft Learn
Open the Table Designer for the table whose primary key you want to modify, right-click in the Table Designer, and choose Indexes/Keys from...
Read more >SQL PRIMARY KEY Constraint - W3Schools
The PRIMARY KEY constraint uniquely identifies each record in a table. ... this primary key can consist of single or multiple columns (fields)....
Read more >Change primary key column in SQL Server - Stack Overflow
Make sure there are no NULLs in that column for any row · Set the column to not allow NULLs · Add the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@eagle-r, It’s a bad idea to pass an API Key in a URL. You’re essentially exposing your API Key.
With your reference to #34, that’s a solution. However, I think it’s actually a poor fix for the actual problem.
@florimondmanca, we need to normalize the table to have a generic based integer PK. With the completion of #34, those who need to change the PK to some other form of ID, say a UUID, will have the flexibility to do so.
@eagle-r and @florimondmanca, In my opinion, while this is technically not a bug and is more of a feature enhancement, the issue should be considered with the same level of priority as a bug.
Using a Model View Set requires a PK. The current PK we have is not a valid form of PK.