Merge pull request #16443 from Botik/sequelize-indexes

[sequelize] add where option to DefineIndexesOptions for v4
This commit is contained in:
Arthur Ozga
2017-05-16 13:26:36 -07:00
committed by GitHub
2 changed files with 9 additions and 1 deletions
+5
View File
@@ -4792,6 +4792,11 @@ declare namespace sequelize {
*/
operator?: string;
/**
* Condition for partioal index
*/
where?: WhereOptions;
}
/**
+4 -1
View File
@@ -1290,7 +1290,10 @@ s.define( 'UserWithUniqueUsername', {
name : 'user_and_email_index',
unique : true,
method : 'BTREE',
fields : ['user_id', { attribute : 'email', collate : 'en_US', order : 'DESC', length : 5 }]
fields : ['user_id', { attribute : 'email', collate : 'en_US', order : 'DESC', length : 5 }],
where : {
user_id : { $not: null }
}
},
{
fields: ['data'],