3 ms·
Is there any best practice on implementing an ID field that starts at 1 for each repository (in GH's example)?
by slig 7y ago
Is there any best practice on implementing an ID field that starts at 1 for each repository (in GH's example)?
- dexterdog 7y agoIf you're using a UUID you can just use whichever huge integer your UUID represents and then increment from there so the records are all sequential 128bit numbers.
- kevsim 7y agoI guess it would be pretty easy in postgres to create a sequence per repository and have the field use the next value in the sequence (i.e. like it normally does for auto incrementing IDs but where you'd specify the sequence to use at insert time).
- slig 7y agoThanks, I'll have a look!