Answer the question
In order to leave comments, you need to log in
How to use 8 character UUID as id in sequelizejs?
Hello, how to use 8 character UUID as id in sequelizejs?
I can generate it myself, but if it suddenly matches an id that will already be in the database, then there will be an error and the action will not be performed.
id: {
type: Sequelize.UUID,
primaryKey: true,
autoIncrement: true
}
Answer the question
In order to leave comments, you need to log in
autoIncrement - you will always have an int.
To avoid repetition, you should generate with a low probability of repetition, for example https://www.npmjs.com/package/uuid
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question