[sequelize] add where option to DefineIndexesOptions for v4

This commit is contained in:
Botik
2017-05-10 14:43:02 +03:00
parent 8868f90acf
commit d5a5da8e7f
2 changed files with 11 additions and 3 deletions
+7 -2
View File
@@ -3247,8 +3247,8 @@ declare namespace sequelize {
* https://github.com/sequelize/sequelize/blob/master/docs/docs/models-usage.md#user-content-manipulating-the-dataset-with-limit-offset-order-and-group
*/
group?: string | string[] | Object;
/**
* Apply DISTINCT(col) for FindAndCount(all)
*/
@@ -4784,6 +4784,11 @@ declare namespace sequelize {
*/
operator?: string;
/**
* Condition for partioal index
*/
where?: WhereOptions;
}
/**
+4 -1
View File
@@ -1285,7 +1285,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'],