From 4c53abad32c4d6fc9cd12188789ea7d3276448e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Bajto=C5=A1?= Date: Tue, 12 May 2020 09:36:17 +0200 Subject: [PATCH] types: allow no `models` argument for automigrate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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š --- types/datasource.d.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/types/datasource.d.ts b/types/datasource.d.ts index 47673c5e..d124ffd3 100644 --- a/types/datasource.d.ts +++ b/types/datasource.d.ts @@ -140,13 +140,13 @@ export declare class DataSource extends EventEmitter { */ attach(modelClass: ModelBaseClass): ModelBaseClass; - automigrate(models: string | string[]): Promise; + automigrate(models?: string | string[]): Promise; // legacy callback style - automigrate(models: string | string[], callback: Callback): void; + automigrate(models: string | string[] | undefined, callback: Callback): void; - autoupdate(models: string | string[]): Promise; + autoupdate(models?: string | string[]): Promise; // legacy callback style - autoupdate(models: string | string[], callback: Callback): void; + autoupdate(models: string | string[] | undefined, callback: Callback): void; discoverModelDefinitions( options?: Options,