types: allow no `models` argument for automigrate

Fix type definitions to allow zero-argument invocation of
the following database migration methods:
  - `DataSource.automigrate()`
  - `DataSource.autoupdate()`

Implementation-wise, when no model names are specified, then ALL models
attached to the datasource are migrated.

Signed-off-by: Miroslav Bajtoš <mbajtoss@gmail.com>
This commit is contained in:
Miroslav Bajtoš 2020-05-12 09:36:17 +02:00
parent 429d13e537
commit 4c53abad32
No known key found for this signature in database
GPG Key ID: 6F2304BA9361C7E3
1 changed files with 4 additions and 4 deletions

View File

@ -140,13 +140,13 @@ export declare class DataSource extends EventEmitter {
*/
attach(modelClass: ModelBaseClass): ModelBaseClass;
automigrate(models: string | string[]): Promise<void>;
automigrate(models?: string | string[]): Promise<void>;
// legacy callback style
automigrate(models: string | string[], callback: Callback): void;
automigrate(models: string | string[] | undefined, callback: Callback): void;
autoupdate(models: string | string[]): Promise<void>;
autoupdate(models?: string | string[]): Promise<void>;
// legacy callback style
autoupdate(models: string | string[], callback: Callback): void;
autoupdate(models: string | string[] | undefined, callback: Callback): void;
discoverModelDefinitions(
options?: Options,