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

Method truncate

lib/model.js:2894–2898  ·  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

2892 * {@link Model.destroy} for more information
2893 */
2894 static async truncate(options) {
2895 options = Utils.cloneDeep(options) || {};
2896 options.truncate = true;
2897 return await this.destroy(options);
2898 }
2899
2900 /**
2901 * Delete multiple instances, or set their deletedAt timestamp to the current time if `paranoid` is enabled.

Callers 2

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

Calls 1

destroyMethod · 0.95

Tested by

no test coverage detected