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

Method _findAutoIncrementAttribute

lib/model.js:301–315  ·  lib/model.js::Model._findAutoIncrementAttribute
()

Source from the content-addressed store, hash-verified

299 }
300
301 static _findAutoIncrementAttribute() {
302 this.autoIncrementAttribute = null;
303
304 for (const name in this.rawAttributes) {
305 if (Object.prototype.hasOwnProperty.call(this.rawAttributes, name)) {
306 const definition = this.rawAttributes[name];
307 if (definition && definition.autoIncrement) {
308 if (this.autoIncrementAttribute) {
309 throw new Error(class="st">'Invalid Instance definition. Only one autoincrement field allowed.');
310 }
311 this.autoIncrementAttribute = name;
312 }
313 }
314 }
315 }
316
317 static _conformIncludes(options, self) {
318 if (!options.include) return;

Callers 1

initMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected