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 ff83d129
authored
Oct 23, 2014
by
Joel Trost
Committed by
Matt Broadstone
Dec 09, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More exclusion of cascade contraints
1 parent
1bcb67ce
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
lib/dialects/mssql/query-generator.js
lib/dialects/mssql/query-generator.js
View file @
ff83d12
...
@@ -342,8 +342,7 @@ module.exports = (function() {
...
@@ -342,8 +342,7 @@ module.exports = (function() {
var
casKey
=
cascadeCheck
[
i
];
var
casKey
=
cascadeCheck
[
i
];
for
(
var
j
=
i
+
1
;
j
<
cascadeCheck
.
length
;
j
++
){
for
(
var
j
=
i
+
1
;
j
<
cascadeCheck
.
length
;
j
++
){
var
casKey2
=
cascadeCheck
[
j
];
var
casKey2
=
cascadeCheck
[
j
];
if
(
attributes
[
casKey
].
references
===
attributes
[
casKey2
].
references
if
(
attributes
[
casKey
].
referencesKey
===
attributes
[
casKey2
].
referencesKey
){
&&
attributes
[
casKey
].
referencesKey
===
attributes
[
casKey2
].
referencesKey
){
console
.
warn
(
'MSSQL does not support multiple cascade keys on the same reference, '
console
.
warn
(
'MSSQL does not support multiple cascade keys on the same reference, '
+
'we will removing them to make this work but we recommend restructuring your query.'
);
+
'we will removing them to make this work but we recommend restructuring your query.'
);
attributes
[
casKey
].
onDelete
=
''
;
attributes
[
casKey
].
onDelete
=
''
;
...
@@ -429,13 +428,14 @@ module.exports = (function() {
...
@@ -429,13 +428,14 @@ module.exports = (function() {
}
}
// add 1st string as quoted, 2nd as unquoted raw
// add 1st string as quoted, 2nd as unquoted raw
var
sql
=
(
i
>
0
?
SqlGenerator
.
quoteIdentifier
(
tableNames
.
join
(
'.'
))
+
'.'
:
''
)
+
this
.
quote
(
obj
[
i
],
parent
,
force
);
var
sql
=
(
i
>
0
?
SqlGenerator
.
quoteIdentifier
(
tableNames
.
join
(
'.'
))
+
'.'
:
''
)
+
this
.
quote
(
obj
[
i
],
parent
,
force
);
if
(
i
<
len
-
1
)
{
if
(
i
<
len
-
1
)
{
sql
+=
' '
+
obj
[
i
+
1
];
sql
+=
' '
+
obj
[
i
+
1
];
}
}
return
sql
;
return
sql
;
}
else
if
(
obj
.
_modelAttribute
)
{
}
else
if
(
obj
.
_modelAttribute
)
{
return
SqlGenerator
.
quoteIdentifer
(
obj
.
Model
.
name
)
+
'.'
+
obj
.
fieldName
;
return
SqlGenerator
.
quoteIdentif
i
er
(
obj
.
Model
.
name
)
+
'.'
+
obj
.
fieldName
;
}
else
if
(
obj
.
_isSequelizeMethod
)
{
}
else
if
(
obj
.
_isSequelizeMethod
)
{
return
this
.
handleSequelizeMethod
(
obj
);
return
this
.
handleSequelizeMethod
(
obj
);
}
else
if
(
Utils
.
_
.
isObject
(
obj
)
&&
'raw'
in
obj
)
{
}
else
if
(
Utils
.
_
.
isObject
(
obj
)
&&
'raw'
in
obj
)
{
...
...
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