不要怂,就是干,撸起袖子干!

Commit 819e9ddb by Hang Jiang Committed by Sushant

fix(types): add getForeignKeyReferencesForTable type (#11738)

1 parent eccf973e
...@@ -673,6 +673,15 @@ class QueryInterface { ...@@ -673,6 +673,15 @@ class QueryInterface {
return this.sequelize.query(sql, Object.assign({}, options, { type: QueryTypes.SHOWINDEXES })); 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) { getForeignKeysForTables(tableNames, options) {
if (tableNames.length === 0) { if (tableNames.length === 0) {
return Promise.resolve({}); return Promise.resolve({});
......
...@@ -443,6 +443,11 @@ export class QueryInterface { ...@@ -443,6 +443,11 @@ export class QueryInterface {
public getForeignKeysForTables(tableNames: string, options?: QueryInterfaceOptions): Promise<object>; 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 * Inserts a new record
*/ */
public insert(instance: Model, tableName: string, values: object, options?: QueryOptions): Promise<object>; public insert(instance: Model, tableName: string, values: object, options?: QueryOptions): Promise<object>;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!