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 5cd59bc0
authored
Jan 11, 2014
by
Sascha Gehlich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved normalizing of attribute.values to DaoFactory#define
1 parent
9dd74200
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
6 deletions
lib/dialects/mysql/query-generator.js
lib/sequelize.js
lib/dialects/mysql/query-generator.js
View file @
5cd59bc
...
...
@@ -292,12 +292,6 @@ module.exports = (function() {
if
(
Utils
.
isHash
(
dataType
))
{
var
template
// We have special cases where the type is an object containing
// the values (e.g. Sequelize.ENUM(value, value2) returns an object
// instead of a function)
// Copy these values to the dataType
dataType
.
values
=
dataType
.
type
.
values
||
dataType
.
values
;
if
(
dataType
.
type
.
toString
()
===
DataTypes
.
ENUM
.
toString
())
{
if
(
Array
.
isArray
(
dataType
.
values
)
&&
(
dataType
.
values
.
length
>
0
))
{
template
=
"ENUM("
+
Utils
.
_
.
map
(
dataType
.
values
,
function
(
value
)
{
...
...
lib/sequelize.js
View file @
5cd59bc
...
...
@@ -203,6 +203,13 @@ module.exports = (function() {
// If you don't specify a valid data type lets help you debug it
Utils
.
_
.
each
(
attributes
,
function
(
dataType
,
name
)
{
if
(
Utils
.
isHash
(
dataType
))
{
// We have special cases where the type is an object containing
// the values (e.g. Sequelize.ENUM(value, value2) returns an object
// instead of a function)
// Copy these values to the dataType
dataType
.
values
=
(
dataType
.
type
&&
dataType
.
type
.
values
)
||
dataType
.
values
;
// We keep on working with the actual type object
dataType
=
dataType
.
type
}
...
...
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