This Sequelize commit seems to confirm that naming the primary key 'id' makes it special. And, based on my tests with the following snippet, changing the field name to something other than "id" is enough so that the default value is not set, and therefore the inserts do not work.
id: { type: DataTypes.UUID, primaryKey: true, defaultValue: DataTypes.UUIDV4, allowNull: false }
So, is there a way to keep the flexibility of naming primary key fields and using UUID by default?
source share