Sequelize Add documented props to SyncOptions (#16976)

* Added alter, hooks, and searchPath to syncOptions interface with compiler test and documentation comments (straight from sequelize v4 docs)

* Fix implicit any return type error
This commit is contained in:
snewell92
2017-06-05 18:33:06 -05:00
committed by Mohamed Hegazy
parent ae77e5216b
commit b860983357
2 changed files with 29 additions and 2 deletions

View File

@@ -3165,7 +3165,7 @@ declare namespace sequelize {
* Load further nested related models
*/
include?: Array<Model<any, any> | IncludeOptions>;
/**
* If true, only non-deleted records will be returned. If false, both deleted and non-deleted records will
* be returned. Only applies if `options.paranoid` is true for the model.
@@ -3260,7 +3260,7 @@ declare namespace sequelize {
* Apply DISTINCT(col) for FindAndCount(all)
*/
distinct?: boolean;
/**
* Prevents a subquery on the main table when using include
*/
@@ -5052,6 +5052,22 @@ declare namespace sequelize {
*/
schema?: string;
/**
* Alters tables to fit models. Not recommended for production use. Deletes data in columns
* that were removed or had their type changed in the model.
*/
alter?: boolean;
/**
* If hooks is true then beforeSync, afterSync, beforBulkSync, afterBulkSync hooks will be called
*/
hooks?: boolean;
/**
* An optional parameter to specify the schema search_path (Postgres only)
*/
searchPath?: string;
}
interface SetOptions { }

View File

@@ -1670,3 +1670,14 @@ s.transaction((): Q.Promise<void> => {
resolve(null);
});
});
// sync options types
s.sync({
alter: true,
force: true,
hooks: false,
searchPath: 'some/path/',
schema: 'schema',
logging: () => {},
match: new RegExp('\d{4,}')
});