mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
[sequelize] add where option to DefineIndexesOptions (#16357)
This commit is contained in:
parent
da3ab04e72
commit
c49e2aa150
5
types/sequelize/v3/index.d.ts
vendored
5
types/sequelize/v3/index.d.ts
vendored
@ -4757,6 +4757,11 @@ declare namespace sequelize {
|
||||
*/
|
||||
fields?: Array<string | { attribute: string, length: number, order: string, collate: string }>;
|
||||
|
||||
/**
|
||||
* Condition for partioal index
|
||||
*/
|
||||
where?: WhereOptions;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -1261,7 +1261,7 @@ s.define( 'UserWithUniqueUsername', {
|
||||
username : { type : Sequelize.STRING, unique : { name : 'user_and_email', msg : 'User and email must be unique' } },
|
||||
email : { type : Sequelize.STRING, unique : 'user_and_email' }
|
||||
} );
|
||||
/* NOTE https://github.com/DefinitelyTyped/DefinitelyTyped/pull/5590
|
||||
|
||||
s.define( 'UserWithUniqueUsername', {
|
||||
user_id : { type : Sequelize.INTEGER },
|
||||
email : { type : Sequelize.STRING }
|
||||
@ -1269,13 +1269,15 @@ s.define( 'UserWithUniqueUsername', {
|
||||
indexes : [
|
||||
{
|
||||
name : 'user_and_email_index',
|
||||
msg : 'User and email must be unique',
|
||||
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 }
|
||||
}
|
||||
}]
|
||||
} );
|
||||
*/
|
||||
|
||||
s.define( 'TaskBuild', {
|
||||
title : { type : Sequelize.STRING, defaultValue : 'a task!' },
|
||||
foo : { type : Sequelize.INTEGER, defaultValue : 2 },
|
||||
|
||||
Loading…
Reference in New Issue
Block a user