Skip to content

Replace autoincrement id with cuid

supriya kotturu requested to merge replace-autoincrement-id-with-cuid into main

ISSUE

Currently, using auto-increment numbers as id might lead to migrating to UUID/GUID alternative in the near future. But the issue with UUID is that it is a randomly generated string, where the probability of collision (having the same UUID generated again) is not zero, but close to zero.

CUID helps us solve this problem while also improving our search performance. There's also NanoID which is shorter and better preforment. But since Prisma is already having CUID built in, it makes sense to utilize it for our current usecase, without going overboard.

Refer : How CUID works

This PR, contains the updated schema, which replaces the auto-increment ID with UUID.

Merge request reports