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:
parent
429d13e537
commit
4c53abad32
|
@ -140,13 +140,13 @@ export declare class DataSource extends EventEmitter {
|
||||||
*/
|
*/
|
||||||
attach(modelClass: ModelBaseClass): ModelBaseClass;
|
attach(modelClass: ModelBaseClass): ModelBaseClass;
|
||||||
|
|
||||||
automigrate(models: string | string[]): Promise<void>;
|
automigrate(models?: string | string[]): Promise<void>;
|
||||||
// legacy callback style
|
// 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
|
// legacy callback style
|
||||||
autoupdate(models: string | string[], callback: Callback): void;
|
autoupdate(models: string | string[] | undefined, callback: Callback): void;
|
||||||
|
|
||||||
discoverModelDefinitions(
|
discoverModelDefinitions(
|
||||||
options?: Options,
|
options?: Options,
|
||||||
|
|
Loading…
Reference in New Issue