MCPcopy
hub / github.com/sequelize/sequelize / truncate

Method truncate

src/model.js:2996–3000  ·  view source on GitHub ↗

* Truncate all instances of the model. This is a convenient method for Model.destroy({ truncate: true }). * * @param {object} [options] The options passed to Model.destroy in addition to truncate * @param {boolean|Function} [options.cascade = false] Truncates all tables that have

(options)

Source from the content-addressed store, hash-verified

2994 * {@link Model.destroy} for more information
2995 */
2996 static async truncate(options) {
2997 options = Utils.cloneDeep(options) || {};
2998 options.truncate = true;
2999 return await this.destroy(options);
3000 }
3001
3002 /**
3003 * Delete multiple instances, or set their deletedAt timestamp to the current time if `paranoid` is enabled.

Callers 3

model.test.jsFile · 0.45
sequelize.test.jsFile · 0.45
truncate.test.jsFile · 0.45

Calls 1

destroyMethod · 0.95

Tested by

no test coverage detected