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 a3f7d94b
authored
Nov 11, 2014
by
Joel Trost
Committed by
Matt Broadstone
Dec 09, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed schema delimiting
1 parent
ec40906e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
6 deletions
lib/dialects/mssql/query-generator.js
lib/dialects/mssql/sql-generator.js
lib/dialects/mssql/query-generator.js
View file @
a3f7d94
...
@@ -160,7 +160,6 @@ module.exports = (function() {
...
@@ -160,7 +160,6 @@ module.exports = (function() {
ignoreKeys
=
[];
ignoreKeys
=
[];
for
(
var
key
in
attributes
){
for
(
var
key
in
attributes
){
//console.log('some more action', attributes.deletedAtThisTime);
var
aliasKey
=
attributes
[
key
].
field
||
key
;
var
aliasKey
=
attributes
[
key
].
field
||
key
;
if
(
ignoreKeys
.
indexOf
(
aliasKey
)
<
0
){
if
(
ignoreKeys
.
indexOf
(
aliasKey
)
<
0
){
ignoreKeys
.
push
(
aliasKey
);
ignoreKeys
.
push
(
aliasKey
);
...
@@ -363,7 +362,7 @@ module.exports = (function() {
...
@@ -363,7 +362,7 @@ module.exports = (function() {
var
casKey2
=
cascadeCheck
[
j
];
var
casKey2
=
cascadeCheck
[
j
];
if
(
attributes
[
casKey
].
referencesKey
===
attributes
[
casKey2
].
referencesKey
){
if
(
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 remov
ing
them to make this work but we recommend restructuring your query.'
);
+
'we will remov
e
them to make this work but we recommend restructuring your query.'
);
attributes
[
casKey
].
onDelete
=
''
;
attributes
[
casKey
].
onDelete
=
''
;
attributes
[
casKey
].
onUpdate
=
''
;
attributes
[
casKey
].
onUpdate
=
''
;
attributes
[
casKey2
].
onDelete
=
''
;
attributes
[
casKey2
].
onDelete
=
''
;
...
...
lib/dialects/mssql/sql-generator.js
View file @
a3f7d94
...
@@ -246,14 +246,13 @@ module.exports = {
...
@@ -246,14 +246,13 @@ module.exports = {
},
},
quoteTable
:
function
(
param
,
as
)
{
quoteTable
:
function
(
param
,
as
)
{
var
table
=
''
;
var
table
=
''
;
if
(
as
===
true
)
{
if
(
as
===
true
)
{
as
=
param
.
as
||
param
.
name
||
param
;
as
=
param
.
as
||
param
.
name
||
param
;
}
}
if
(
_
.
isObject
(
param
))
{
if
(
_
.
isObject
(
param
))
{
if
(
param
.
schema
)
{
if
(
param
.
schema
)
{
table
+=
param
.
schema
+
'.'
;
table
+=
param
.
schema
+
(
param
.
delimiter
||
'.'
)
;
}
}
table
+=
param
.
tableName
;
table
+=
param
.
tableName
;
table
=
quoteIdentifier
(
table
);
table
=
quoteIdentifier
(
table
);
...
@@ -607,7 +606,6 @@ module.exports = {
...
@@ -607,7 +606,6 @@ module.exports = {
if
(
attribute
.
references
)
{
if
(
attribute
.
references
)
{
template
.
push
(
attributeMap
.
references
);
template
.
push
(
attributeMap
.
references
);
template
.
push
(
this
.
quoteTable
(
attribute
.
references
));
template
.
push
(
this
.
quoteTable
(
attribute
.
references
));
if
(
attribute
.
referencesKey
)
{
if
(
attribute
.
referencesKey
)
{
template
.
push
(
'('
+
quoteIdentifier
(
attribute
.
referencesKey
)
+
')'
);
template
.
push
(
'('
+
quoteIdentifier
(
attribute
.
referencesKey
)
+
')'
);
}
else
{
}
else
{
...
@@ -718,7 +716,6 @@ module.exports = {
...
@@ -718,7 +716,6 @@ module.exports = {
return
query
.
join
(
' '
);
return
query
.
join
(
' '
);
},
},
getJoinClause
:
function
(
model
,
include
){
getJoinClause
:
function
(
model
,
include
){
//console.log(include.through);
var
query
=
[];
var
query
=
[];
var
primaryKey
=
quoteIdentifier
(
model
.
primaryKeyAttribute
);
var
primaryKey
=
quoteIdentifier
(
model
.
primaryKeyAttribute
);
var
joinType
=
include
.
required
?
'INNER JOIN'
:
'LEFT OUTER JOIN'
;
var
joinType
=
include
.
required
?
'INNER JOIN'
:
'LEFT OUTER JOIN'
;
...
...
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