Re: Need to Replace django default I'd with UUID field

2022-12-08 Thread Clive Bruton
It's more or less the same problem, use a new field to insert your new foreign keys (UUIDs), looking them up via your old foreign keys to get the new UUID values. Or, as the other Jason suggests, if you can, just use the UUIDs for external access. -- Clive On 22 Nov 2022, at 19:02,

Re: Need to Replace django default I'd with UUID field

2022-11-22 Thread Jason
why? use uuid for public resource access, and internal int/bigint for primary keys. that works well with the index structure and doesn't leak sequential information out by URLs. in other words, a resource is accessed via `somesite.com/some-resource/ internally, you do a lookup like

Re: Need to Replace django default I'd with UUID field

2022-11-22 Thread Sebastian Jung
You have also relations like foreignkey to this table? Then you must replace also all ids from foreignkey to new uuid Not simple this task Am Di., 22. Nov. 2022 um 19:55 Uhr schrieb Rajesh Kumar < rjcse131...@gmail.com>: > Hi everyone! > Hope everyone is doing well... > > Actually I have

Re: Need to Replace django default I'd with UUID field

2022-11-22 Thread Rajesh Kumar
Hi Jason, Thanks for a quick reply. I got your point, but I am worry about my existing data/records which is already associated with id , which is default one. On Wed, 23 Nov, 2022, 12:29 am Jason Turner, wrote: > I would just add another column that holds the UUID value instead of > changing

Re: Need to Replace django default I'd with UUID field

2022-11-22 Thread Jason Turner
I would just add another column that holds the UUID value instead of changing the default ID. On Tue, Nov 22, 2022, 12:55 PM Rajesh Kumar wrote: > Hi everyone! > Hope everyone is doing well... > > Actually I have 100+ existing data in my database with default I'd field > of django > Now I need

Need to Replace django default I'd with UUID field

2022-11-22 Thread Rajesh Kumar
Hi everyone! Hope everyone is doing well... Actually I have 100+ existing data in my database with default I'd field of django Now I need to replace that default I'd to UUID. How I can do this without loosing any records of my database. If anyone can give me suggestions that would be great.