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 96a69c2c
authored
Dec 09, 2011
by
sdepold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed unused code
1 parent
beb7bab5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
23 deletions
lib/query-interface.js
lib/query-interface.js
View file @
96a69c2
...
...
@@ -9,16 +9,12 @@ module.exports = (function() {
Utils
.
addEventEmitter
(
QueryInterface
)
QueryInterface
.
prototype
.
createTable
=
function
(
tableName
,
attributes
,
options
)
{
var
sql
=
this
.
QueryGenerator
.
createTableQuery
(
tableName
,
attributes
,
options
)
,
self
=
this
var
sql
=
this
.
QueryGenerator
.
createTableQuery
(
tableName
,
attributes
,
options
)
return
queryAndEmit
.
call
(
this
,
sql
,
'createTable'
)
}
QueryInterface
.
prototype
.
dropTable
=
function
(
tableName
)
{
var
sql
=
this
.
QueryGenerator
.
dropTableQuery
(
tableName
)
,
self
=
this
var
sql
=
this
.
QueryGenerator
.
dropTableQuery
(
tableName
)
return
queryAndEmit
.
call
(
this
,
sql
,
'dropTable'
)
}
...
...
@@ -50,9 +46,7 @@ module.exports = (function() {
}
QueryInterface
.
prototype
.
renameTable
=
function
(
before
,
after
)
{
var
sql
=
this
.
QueryGenerator
.
renameTableQuery
(
before
,
after
)
,
self
=
this
var
sql
=
this
.
QueryGenerator
.
renameTableQuery
(
before
,
after
)
return
queryAndEmit
.
call
(
this
,
sql
,
'renameTable'
)
}
...
...
@@ -96,15 +90,12 @@ module.exports = (function() {
var
options
=
Utils
.
simplifyAttributes
(
attributes
)
,
sql
=
this
.
QueryGenerator
.
addColumnQuery
(
tableName
,
options
)
,
self
=
this
return
queryAndEmit
.
call
(
this
,
sql
,
'addColumn'
)
}
QueryInterface
.
prototype
.
removeColumn
=
function
(
tableName
,
attributeName
)
{
var
sql
=
this
.
QueryGenerator
.
removeColumnQuery
(
tableName
,
attributeName
)
,
self
=
this
var
sql
=
this
.
QueryGenerator
.
removeColumnQuery
(
tableName
,
attributeName
)
return
queryAndEmit
.
call
(
this
,
sql
,
'removeColumn'
)
}
...
...
@@ -118,7 +109,6 @@ module.exports = (function() {
var
options
=
Utils
.
simplifyAttributes
(
attributes
)
,
sql
=
this
.
QueryGenerator
.
changeColumnQuery
(
tableName
,
options
)
,
self
=
this
return
queryAndEmit
.
call
(
this
,
sql
,
'changeColumn'
)
}
...
...
@@ -157,7 +147,12 @@ module.exports = (function() {
}).
run
()
}
QueryInterface
.
prototype
.
addIndex
=
function
()
{
QueryInterface
.
prototype
.
addIndex
=
function
(
tableName
,
attributes
,
options
)
{
var
sql
=
this
.
QueryGenerator
.
addIndexQuery
(
tableName
,
attributes
,
options
)
return
queryAndEmit
.
call
(
this
,
sql
,
'addIndex'
)
}
QueryInterface
.
prototype
.
showIndexes
=
function
()
{
}
...
...
@@ -166,8 +161,7 @@ module.exports = (function() {
}
QueryInterface
.
prototype
.
insert
=
function
(
model
,
tableName
,
values
)
{
var
self
=
this
,
sql
=
self
.
QueryGenerator
.
insertQuery
(
tableName
,
values
)
var
sql
=
this
.
QueryGenerator
.
insertQuery
(
tableName
,
values
)
return
queryAndEmit
.
call
(
this
,
[
sql
,
model
],
'insert'
,
{
success
:
function
(
obj
)
{
obj
.
isNewRecord
=
false
}
...
...
@@ -175,16 +169,12 @@ module.exports = (function() {
}
QueryInterface
.
prototype
.
update
=
function
(
model
,
tableName
,
values
,
identifier
)
{
var
sql
=
this
.
QueryGenerator
.
updateQuery
(
tableName
,
values
,
identifier
)
,
self
=
this
var
sql
=
this
.
QueryGenerator
.
updateQuery
(
tableName
,
values
,
identifier
)
return
queryAndEmit
.
call
(
this
,
[
sql
,
model
],
'update'
)
}
QueryInterface
.
prototype
.
delete
=
function
(
model
,
tableName
,
identifier
)
{
var
sql
=
this
.
QueryGenerator
.
deleteQuery
(
tableName
,
identifier
)
,
self
=
this
var
sql
=
this
.
QueryGenerator
.
deleteQuery
(
tableName
,
identifier
)
return
queryAndEmit
.
call
(
this
,
[
sql
,
model
],
'delete'
)
}
...
...
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