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 e6ddc697
authored
Jan 20, 2016
by
Mick Hansen
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5226 from sushantdhiman/fix-5092
Fix 5092
2 parents
ad124e3b
27d2426a
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
2 deletions
changelog.md
lib/dialects/postgres/query-generator.js
test/integration/model/json.test.js
changelog.md
View file @
e6ddc69
# F
UTURE
# F
uture
-
[
ADDED
]
Support silent: true in bulk update
[
#5200
](
https://github.com/sequelize/sequelize/issues/5200
)
-
[
ADDED
]
Support silent: true in bulk update
[
#5200
](
https://github.com/sequelize/sequelize/issues/5200
)
-
[
FIXED
]
Postgres destroy with
`where`
fails on JSONB data
[
#5092
](
https://github.com/sequelize/sequelize/issues/5092
)
# 3.17.3
# 3.17.3
-
[
FIXED
]
Regression with array values from security fix in 3.17.2
-
[
FIXED
]
Regression with array values from security fix in 3.17.2
...
...
lib/dialects/postgres/query-generator.js
View file @
e6ddc69
...
@@ -375,7 +375,7 @@ var QueryGenerator = {
...
@@ -375,7 +375,7 @@ var QueryGenerator = {
var
replacements
=
{
var
replacements
=
{
table
:
this
.
quoteIdentifiers
(
tableName
),
table
:
this
.
quoteIdentifiers
(
tableName
),
where
:
this
.
getWhereConditions
(
where
),
where
:
this
.
getWhereConditions
(
where
,
null
,
model
,
options
),
limit
:
!!
options
.
limit
?
' LIMIT '
+
this
.
escape
(
options
.
limit
)
:
''
,
limit
:
!!
options
.
limit
?
' LIMIT '
+
this
.
escape
(
options
.
limit
)
:
''
,
primaryKeys
:
primaryKeys
[
tableName
].
length
>
1
?
'('
+
pks
+
')'
:
pks
,
primaryKeys
:
primaryKeys
[
tableName
].
length
>
1
?
'('
+
pks
+
')'
:
pks
,
primaryKeysSelection
:
pks
primaryKeysSelection
:
pks
...
...
test/integration/model/json.test.js
View file @
e6ddc69
...
@@ -310,6 +310,53 @@ describe(Support.getTestDialectTeaser('Model'), function() {
...
@@ -310,6 +310,53 @@ describe(Support.getTestDialectTeaser('Model'), function() {
});
});
});
});
});
});
it
(
'should be possible to destroy with where'
,
function
()
{
var
conditionSearch
=
{
where
:
{
data
:
{
employment
:
'Hacker'
}
}
};
return
Promise
.
join
(
this
.
Event
.
create
({
data
:
{
name
:
{
first
:
'Elliot'
,
last
:
'Alderson'
},
employment
:
'Hacker'
}
}),
this
.
Event
.
create
({
data
:
{
name
:
{
first
:
'Christian'
,
last
:
'Slater'
},
employment
:
'Hacker'
}
}),
this
.
Event
.
create
({
data
:
{
name
:
{
first
:
' Tyrell'
,
last
:
'Wellick'
},
employment
:
'CTO'
}
})
).
bind
(
this
).
then
(
function
()
{
return
expect
(
this
.
Event
.
findAll
(
conditionSearch
)).
to
.
eventually
.
have
.
length
(
2
);
}).
then
(
function
()
{
return
this
.
Event
.
destroy
(
conditionSearch
);
}).
then
(
function
(){
return
expect
(
this
.
Event
.
findAll
(
conditionSearch
)).
to
.
eventually
.
have
.
length
(
0
);
});
});
});
});
}
}
});
});
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