Sequelize UUID data type generates a unique identifier with a random value and does not allow setting a default value while creating a table. This is because the UUID value is generated by the database server itself, and not by the user. However, Sequelize provides default values for other data types such as string, date, and boolean. If you want to set a default value for Sequelize UUID, you need to use a beforeCreate hook to manually generate a UUID value for the record.
Asked: 2023-06-26 19:52:29 +0000
Seen: 14 times
Last updated: Jun 26 '23