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 dd4ceb85
authored
Aug 04, 2014
by
Joe Lutz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add attribute.field support for sync()
1 parent
3970bf71
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
6 deletions
lib/dialects/mysql/query-generator.js
lib/dialects/postgres/query-generator.js
lib/dialects/sqlite/query-generator.js
lib/dialects/mysql/query-generator.js
View file @
dd4ceb8
...
...
@@ -245,6 +245,7 @@ module.exports = (function() {
for
(
var
name
in
attributes
)
{
var
dataType
=
attributes
[
name
];
var
fieldName
=
dataType
.
field
||
name
;
if
(
Utils
.
_
.
isPlainObject
(
dataType
))
{
var
template
;
...
...
@@ -305,9 +306,9 @@ module.exports = (function() {
}
result
[
n
ame
]
=
template
;
result
[
fieldN
ame
]
=
template
;
}
else
{
result
[
n
ame
]
=
dataType
;
result
[
fieldN
ame
]
=
dataType
;
}
}
...
...
lib/dialects/postgres/query-generator.js
View file @
dd4ceb8
...
...
@@ -391,6 +391,7 @@ module.exports = (function() {
for
(
var
name
in
attributes
)
{
var
dataType
=
attributes
[
name
];
var
fieldName
=
dataType
.
field
||
name
;
if
(
Utils
.
_
.
isObject
(
dataType
))
{
var
template
=
'<%= type %>'
...
...
@@ -467,9 +468,9 @@ module.exports = (function() {
replacements
.
comment
=
this
.
escape
(
dataType
.
comment
);
}
result
[
n
ame
]
=
Utils
.
_
.
template
(
template
)(
replacements
);
result
[
fieldN
ame
]
=
Utils
.
_
.
template
(
template
)(
replacements
);
}
else
{
result
[
n
ame
]
=
dataType
;
result
[
fieldN
ame
]
=
dataType
;
}
}
...
...
lib/dialects/sqlite/query-generator.js
View file @
dd4ceb8
...
...
@@ -232,6 +232,7 @@ module.exports = (function() {
for
(
var
name
in
attributes
)
{
var
dataType
=
attributes
[
name
];
var
fieldName
=
dataType
.
field
||
name
;
if
(
Utils
.
_
.
isObject
(
dataType
))
{
var
template
=
"<%= type %>"
...
...
@@ -291,9 +292,9 @@ module.exports = (function() {
}
result
[
n
ame
]
=
Utils
.
_
.
template
(
template
)(
replacements
);
result
[
fieldN
ame
]
=
Utils
.
_
.
template
(
template
)(
replacements
);
}
else
{
result
[
n
ame
]
=
dataType
;
result
[
fieldN
ame
]
=
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