Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
public
/
sequelize
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
不要怂,就是干,撸起袖子干!
Commit 39269912
authored
Apr 20, 2019
by
Mirko Jotic
Committed by
Sushant
Apr 20, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(types): add using & operator index interface (#10813)
1 parent
e3d6795d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
1 deletions
types/lib/model.d.ts
types/test/model.ts
types/lib/model.d.ts
View file @
3926991
...
@@ -1117,6 +1117,16 @@ export interface ModelIndexesOptions {
...
@@ -1117,6 +1117,16 @@ export interface ModelIndexesOptions {
* should be sorted in), `collate` (the collation (sort order) for the column)
* should be sorted in), `collate` (the collation (sort order) for the column)
*/
*/
fields
?:
(
string
|
{
attribute
:
string
;
length
:
number
;
order
:
string
;
collate
:
string
})[];
fields
?:
(
string
|
{
attribute
:
string
;
length
:
number
;
order
:
string
;
collate
:
string
})[];
/**
* Type of search index. Postgres only
*/
using
?:
string
;
/**
* Index operator type. Postgres only
*/
operator
?:
string
;
}
}
/**
/**
...
...
types/test/model.ts
View file @
3926991
import
{
Association
,
HasOne
,
Model
}
from
'sequelize'
;
import
{
Association
,
HasOne
,
Model
,
Sequelize
,
DataTypes
}
from
'sequelize'
;
class
MyModel
extends
Model
{
class
MyModel
extends
Model
{
public
static
associations
:
{
public
static
associations
:
{
...
@@ -10,3 +10,17 @@ class MyModel extends Model {
...
@@ -10,3 +10,17 @@ class MyModel extends Model {
}
}
const
assoc
:
Association
=
MyModel
.
associations
.
other
;
const
assoc
:
Association
=
MyModel
.
associations
.
other
;
const
sequelize
=
new
Sequelize
(
'mysql://user:user@localhost:3306/mydb'
);
MyModel
.
init
({},
{
indexes
:
[
{
fields
:
[
'foo'
],
using
:
'gin'
,
operator
:
'jsonb_path_ops'
,
}
],
sequelize
,
tableName
:
'my_model'
});
\ No newline at end of file
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment