title: Sequelize sets ID field to null (non-sequential)
body: <p>I'm using Sequelize with Postgres 12.4, and I prefer using UUIDs to sequential IDs, even though this always causes headaches with <em>any</em> ORM. I had previously had this working by using a beforeCreate hook that set a random UUID, but this approach becomes quite complicated if you need to do upserts, which I do, so I'm trying to get Postgres to generate the UUIDs for me. I have this working now using the following sequelize attribute definition:</p>
  <pre><code>      id: { type: Sequelize.UUID, primaryKey: true, defaultValue: Sequelize.literal('gen_random_uuid()') },
  </code></pre>
  <p>The problem is now that if I attempt to create a new object using <code>MyModel.create({name: &quot;asdf&quot;})</code>, Sequelize will attempt to upsert a row that includes the <code>id</code> field set to null. This is similar to the issue described in <a href="https://stackoverflow.com/questions/36074800/id-null-when-creating-a-new-item-in-sequelize">this StackOverflow question</a>, but the solution presented there is only valid for sequential numeric IDs. I've also read suggestions including setting the <code>omitNulls</code> field at the Sequelize interface level, but there are many cases where I need to overwrite values with null, so setting a global configuration like this is not a workable solution for me.</p>
  <p>I've attempted to set this configuration at the field level, but that doesn't seem to be supported by Sequelize today. There may be a similar option by another name, but the Sequelize API reference doesn't actually seem to contain any definitive documentation for the possible fields that can be included in an attribute definition - it simply says that it can be a string or an object, with no further specification, so I can only really go by the available examples, which don't seem to show anything of the sort.</p>
  <p>Is there any way to instruct Sequelize that my primary key field will be managed by the database and should <em>never</em> be set, without also telling Sequelize that the field is numeric and sequential?</p>