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 f535c634
authored
Feb 10, 2015
by
Mick Hansen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
implement review changes
1 parent
07a559c7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
8 deletions
lib/sql-string.js
test/integration/associations/has-many.test.js
lib/sql-string.js
View file @
f535c63
...
@@ -116,13 +116,7 @@ SqlString.arrayToList = function(array, timeZone, dialect, field) {
...
@@ -116,13 +116,7 @@ SqlString.arrayToList = function(array, timeZone, dialect, field) {
}
}
var
ret
=
'ARRAY['
+
valstr
+
']'
;
var
ret
=
'ARRAY['
+
valstr
+
']'
;
if
(
!!
field
&&
!!
field
.
type
)
{
if
(
!!
field
&&
!!
field
.
type
)
{
// Need to translate DATETIME to TIMESTAMP WITH TIME ZONE for Postgres here
ret
+=
'::'
+
field
.
type
.
toSql
().
replace
(
/
\(\d
+
\)
/g
,
''
);
// There has to be a better solution than this
if
(
dialect
===
"postgres"
)
{
ret
+=
'::'
+
field
.
type
.
toSql
().
replace
(
/
\(\d
+
\)
/g
,
''
).
replace
(
/DATETIME/
,
'TIMESTAMP WITH TIME ZONE'
);
}
else
{
ret
+=
'::'
+
field
.
type
.
toSql
().
replace
(
/
\(\d
+
\)
/g
,
''
);
}
}
}
return
ret
;
return
ret
;
}
else
{
}
else
{
...
...
test/integration/associations/has-many.test.js
View file @
f535c63
...
@@ -2607,7 +2607,7 @@ describe(Support.getTestDialectTeaser('HasMany'), function() {
...
@@ -2607,7 +2607,7 @@ describe(Support.getTestDialectTeaser('HasMany'), function() {
User
.
hasMany
(
Tasks
[
dataType
],
{
foreignKey
:
'userId'
,
keyType
:
dataType
,
constraints
:
false
});
User
.
hasMany
(
Tasks
[
dataType
],
{
foreignKey
:
'userId'
,
keyType
:
dataType
,
constraints
:
false
});
return
Tasks
[
dataType
].
sync
({
force
:
true
}).
then
(
function
()
{
return
Tasks
[
dataType
].
sync
({
force
:
true
}).
then
(
function
()
{
expect
(
Tasks
[
dataType
].
rawAttributes
.
userId
.
type
instanceof
dataType
).
to
.
be
.
ok
;
expect
(
Tasks
[
dataType
].
rawAttributes
.
userId
.
type
).
to
.
be
.
an
.
instanceof
(
dataType
)
;
});
});
});
});
});
});
...
...
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