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 091bac8f
authored
Jun 04, 2015
by
overlookmotel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tidy code for QueryInterface#addIndex
1 parent
c7d96ad1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
12 deletions
lib/query-interface.js
lib/query-interface.js
View file @
091bac8
...
@@ -422,20 +422,12 @@ QueryInterface.prototype.renameColumn = function(tableName, attrNameBefore, attr
...
@@ -422,20 +422,12 @@ QueryInterface.prototype.renameColumn = function(tableName, attrNameBefore, attr
}.
bind
(
this
));
}.
bind
(
this
));
};
};
QueryInterface
.
prototype
.
addIndex
=
function
(
tableName
,
_attributes
,
options
,
_rawTablename
)
{
QueryInterface
.
prototype
.
addIndex
=
function
(
tableName
,
attributes
,
options
,
rawTablename
)
{
var
attributes
,
rawTablename
;
// Support for passing tableName, attributes, options or tableName, options (with a fields param which is the attributes)
// Support for passing tableName, attributes, options or tableName, options (with a fields param which is the attributes)
if
(
Array
.
isArray
(
_attributes
))
{
if
(
!
Array
.
isArray
(
attributes
))
{
attributes
=
_attributes
;
rawTablename
=
_rawTablename
;
}
else
{
// Support for passing an options object with a fields attribute instead of attributes, options
options
=
_attributes
;
attributes
=
options
.
fields
;
rawTablename
=
options
;
rawTablename
=
options
;
options
=
attributes
;
attributes
=
options
.
fields
;
}
}
if
(
!
rawTablename
)
{
if
(
!
rawTablename
)
{
...
...
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