Skip to content

Commit

Permalink
fix(types): add getForeignKeyReferencesForTable type (#11738)
Browse files Browse the repository at this point in the history
  • Loading branch information
nodejh authored and sushantdhiman committed Dec 12, 2019
1 parent eccf973 commit 819e9dd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/query-interface.js
Expand Up @@ -673,6 +673,15 @@ class QueryInterface {
return this.sequelize.query(sql, Object.assign({}, options, { type: QueryTypes.SHOWINDEXES }));
}


/**
* Returns all foreign key constraints of a table
*
* @param {string[]} tableNames table names
* @param {Object} [options] Query options
*
* @returns {Promise}
*/
getForeignKeysForTables(tableNames, options) {
if (tableNames.length === 0) {
return Promise.resolve({});
Expand Down
5 changes: 5 additions & 0 deletions types/lib/query-interface.d.ts
Expand Up @@ -442,6 +442,11 @@ export class QueryInterface {
*/
public getForeignKeysForTables(tableNames: string, options?: QueryInterfaceOptions): Promise<object>;

/**
* Get foreign key references details for the table
*/
public getForeignKeyReferencesForTable(tableName: string, options?: QueryInterfaceOptions): Promise<object>;

/**
* Inserts a new record
*/
Expand Down

0 comments on commit 819e9dd

Please sign in to comment.