Wouldn’t it be enough to automatically increase the player character ID and database ID? You don’t need to set the ID yourself Every time you add a new role, the server ID will be automatically +1 It will be unique in the same table
If it is multiple tables
Unique ID solution for sub-database and sub-table, You can create a special ID table id_table, with only one column of ID and it is the primary key Every time you insert a player role player_role record, first insert a record into the id_table and then use LAST_INSERT_ID as player_role new id
Wouldn’t it be enough to automatically increase the player character ID and database ID?
You don’t need to set the ID yourself
Every time you add a new role, the server ID will be automatically +1
It will be unique in the same table
Unique ID solution for sub-database and sub-table,
You can create a special ID table id_table, with only one column of ID and it is the primary key
Every time you insert a player role player_role record, first insert a record into the id_table and then
use LAST_INSERT_ID as player_role new id
How can it be guaranteed to be unique if it’s too short?
Maybe you can refer to it first:
shortuuid
Questions I answered: Python-QA
A self-increasing int64 or something is fine