From 079b3543d96b9794d0ae1e82a466adc37c51ec39 Mon Sep 17 00:00:00 2001 From: Sebastian Vera Date: Wed, 13 Mar 2019 18:06:01 +0100 Subject: [PATCH] Add missing option's concurrently attribute to Sequelize addIndex method --- types/sequelize/index.d.ts | 5 +++++ types/sequelize/sequelize-tests.ts | 1 + 2 files changed, 6 insertions(+) diff --git a/types/sequelize/index.d.ts b/types/sequelize/index.d.ts index 9aba040234..73e3f3c222 100644 --- a/types/sequelize/index.d.ts +++ b/types/sequelize/index.d.ts @@ -5025,6 +5025,11 @@ declare namespace sequelize { * A hash of attributes to limit your index(Filtered Indexes - MSSQL & PostgreSQL only) */ where?: AnyWhereOptions; + + /** + * Pass CONCURRENT so other operations run while the index is created - PostgresSQL only. Default is false + */ + concurrently?: boolean; } /** diff --git a/types/sequelize/sequelize-tests.ts b/types/sequelize/sequelize-tests.ts index 3a13906f06..588b3728d2 100644 --- a/types/sequelize/sequelize-tests.ts +++ b/types/sequelize/sequelize-tests.ts @@ -1186,6 +1186,7 @@ queryInterface.addIndex( { schema : 'a', tableName : 'c' }, ['d', 'e'], { loggin queryInterface.showIndex( { schema : 'schema', tableName : 'table' }, { logging : function() {} } ); queryInterface.addIndex( 'Group', ['from'] ); queryInterface.addIndex( 'Group', ['from'], { indexName: 'group_from' } ); +queryInterface.addIndex("Group", ["from"], { concurrently: true }); queryInterface.describeTable( '_Users', { logging : function() {} } ); queryInterface.createTable( 's', { table_id : { type : Sequelize.INTEGER, primaryKey : true, autoIncrement : true } } ); /* NOTE https://github.com/DefinitelyTyped/DefinitelyTyped/pull/5590