$ open source · GPL-3.0 — need a commercial license? imqueue.com →

BaseModel.sync() method

Creates this model's table, or does nothing when the model is a view.

Signature:

static sync(options?: SyncOptions): Promise<any>;

Parameters

Parameter

Type

Description

options

SyncOptions

(Optional) Sequelize's own sync options.

Returns:

Promise<any>

Resolves when the table exists, or immediately for a view.

Remarks

A view is skipped deliberately: it normally selects from tables that do not exist yet, so views are left to the second pass Sequelize.sync() runs once every table is there.