MCPcopy
hub / github.com/sequelize/sequelize / _findAutoIncrementAttribute

Method _findAutoIncrementAttribute

src/model.js:324–338  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

322 }
323
324 static _findAutoIncrementAttribute() {
325 this.autoIncrementAttribute = null;
326
327 for (const name in this.rawAttributes) {
328 if (Object.prototype.hasOwnProperty.call(this.rawAttributes, name)) {
329 const definition = this.rawAttributes[name];
330 if (definition && definition.autoIncrement) {
331 if (this.autoIncrementAttribute) {
332 throw new Error('Invalid Instance definition. Only one autoincrement field allowed.');
333 }
334 this.autoIncrementAttribute = name;
335 }
336 }
337 }
338 }
339
340 static _conformIncludes(options, self) {
341 if (!options.include) return;

Callers 1

initMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected