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 72925cf7
authored
Jun 07, 2020
by
Marquitos
Committed by
GitHub
Jun 07, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: add missing fields to 'FindOrCreateType' (#12338)
1 parent
f3671912
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
4 deletions
types/lib/model.d.ts
types/test/model.ts
types/lib/model.d.ts
View file @
72925cf
...
@@ -685,12 +685,11 @@ export interface Hookable {
...
@@ -685,12 +685,11 @@ export interface Hookable {
/**
/**
* Options for Model.findOrCreate method
* Options for Model.findOrCreate method
*/
*/
export
interface
FindOrCreateOptions
extends
Logging
,
Transactionable
{
export
interface
FindOrCreateOptions
extends
Filterable
,
Logging
,
Transactionable
{
/**
/**
*
A hash of search attributes.
*
The fields to insert / update. Defaults to all fields
*/
*/
where
:
WhereOptions
;
fields
?:
string
[];
/**
/**
* Default values to use if building a new instance
* Default values to use if building a new instance
*/
*/
...
...
types/test/model.ts
View file @
72925cf
...
@@ -99,6 +99,20 @@ UserModel.findCreateFind({
...
@@ -99,6 +99,20 @@ UserModel.findCreateFind({
})
})
/**
/**
* Tests for findOrCreate() type.
*/
UserModel
.
findOrCreate
({
fields
:
[
"jane.doe"
],
where
:
{
username
:
"jane.doe"
},
defaults
:
{
username
:
"jane.doe"
}
})
/**
* Test for primaryKeyAttributes.
* Test for primaryKeyAttributes.
*/
*/
class
TestModel
extends
Model
{};
class
TestModel
extends
Model
{};
...
...
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