mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-06-05 14:59:37 +08:00
merged changes for Nick Mueller <https://github.com/morpheusxaut> from v3 to v4
Tickets: * https://github.com/DefinitelyTyped/DefinitelyTyped/issues/19014
This commit is contained in:
3
types/sequelize/index.d.ts
vendored
3
types/sequelize/index.d.ts
vendored
@@ -5,6 +5,7 @@
|
||||
// Ivan Drinchev <https://github.com/drinchev>
|
||||
// Brendan Abolivier <https://github.com/babolivier>
|
||||
// Patsakol Tangjitcharoenchai <https://github.com/kukoo1>
|
||||
// Nick Mueller <https://github.com/morpheusxaut>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
@@ -4868,7 +4869,7 @@ declare namespace sequelize {
|
||||
* (field name), `length` (create a prefix index of length chars), `order` (the direction the column
|
||||
* should be sorted in), `collate` (the collation (sort order) for the column)
|
||||
*/
|
||||
fields?: Array<string | { attribute: string, length: number, order: string, collate: string }>;
|
||||
fields?: Array<string | fn | { attribute: string, length: number, order: string, collate: string }>;
|
||||
|
||||
/**
|
||||
* Method the index should use, for example 'gin' index.
|
||||
|
||||
@@ -1627,6 +1627,40 @@ s.define( 'TriggerTest', {
|
||||
hasTrigger : true
|
||||
} );
|
||||
|
||||
s.define('DefineOptionsIndexesTest', {
|
||||
id: {
|
||||
type: Sequelize.INTEGER,
|
||||
autoIncrement: true,
|
||||
primaryKey: true,
|
||||
validate: {
|
||||
min: 1
|
||||
}
|
||||
},
|
||||
email: {
|
||||
allowNull: false,
|
||||
type: Sequelize.STRING(255),
|
||||
set: function (val) {
|
||||
if (typeof val === "string") {
|
||||
val = val.toLowerCase();
|
||||
} else {
|
||||
throw new Error("email must be a string");
|
||||
}
|
||||
this.setDataValue("email", val);
|
||||
}
|
||||
}
|
||||
}, {
|
||||
timestamps: false,
|
||||
indexes: [
|
||||
{
|
||||
name: "DefineOptionsIndexesTest_lower_email",
|
||||
unique: true,
|
||||
fields: [
|
||||
Sequelize.fn("LOWER", Sequelize.col("email"))
|
||||
]
|
||||
}
|
||||
]
|
||||
} );
|
||||
|
||||
//
|
||||
// Transaction
|
||||
// ~~~~~~~~~~~~~
|
||||
|
||||
Reference in New Issue
Block a user