Casbin Forum runs on Casnode, the open-source Discourse-style forum. Try the Casnode demo →
Casbin Forum

hi, i'm trying to migrate to casdoor for user managerment, the user id is uuid string, but my old system use integer id, for compatibility, is it ok if i change user table's external_id to integer and auto increase or add another column to do the same thing? or if there is any best practice for it?

2views
3users
1 minread

neither, just my application needs an integer user id, so i'm wondering how to generate it properly in casdoor 🙂

do int-to-string convertion and store it in user.Id

if you need orders, store it in user.Ranking

my old application use both id/uuid for internal and external usage :(, trying to migrate to casdoor, i check ranking as well, it seems it could be modified on the ui , i'm thinking

  1. make the jwt include the external_id ( i modify it as int), not sure if there's easy way to do it
  2. add the integer id into ranking , and add a trigger to disable modification on ranking(then i will be available on jwt token), not sure if there's other way to disable modification

handle yourself, these are just trivial things

modify code as you desire

1 / 7
May 2025