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 3034461b
authored
Aug 28, 2013
by
Daniel Durante
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Forgot to check for DAOFactoryManager in DAOFactoryManager.drop() for the dialec…
…t when declaring tableName.
1 parent
fb37f064
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
lib/dao-factory.js
lib/query-interface.js
lib/dao-factory.js
View file @
3034461
...
...
@@ -207,7 +207,8 @@ module.exports = (function() {
DAOFactory
.
prototype
.
drop
=
function
(
options
)
{
// Only Postgres' QueryGenerator.dropTableQuery() will add schema manually
var
tableName
=
!!
options
&&
!!
options
.
schema
&&
this
.
options
.
dialect
===
"postgres"
?
this
.
tableName
:
this
.
getTableName
()
var
isPostgres
=
this
.
options
.
dialect
===
"postgres"
||
(
!!
this
.
daoFactoryManager
&&
this
.
daoFactoryManager
.
sequelize
.
options
.
dialect
===
"postgres"
)
,
tableName
=
isPostgres
?
this
.
tableName
:
this
.
getTableName
()
return
this
.
QueryInterface
.
dropTable
(
tableName
,
options
)
}
...
...
lib/query-interface.js
View file @
3034461
...
...
@@ -194,13 +194,15 @@ module.exports = (function() {
// Just in case if we're trying to drop a non-existing table
daoTable
=
daoTable
.
length
>
0
?
daoTable
[
0
]
:
null
if
(
!!
daoTable
)
{
var
getTableName
=
(
!
options
||
!
options
.
schema
||
options
.
schema
===
"public"
?
''
:
options
.
schema
+
'_'
)
+
tableName
var
keys
=
Object
.
keys
(
daoTable
.
rawAttributes
)
,
keyLen
=
keys
.
length
,
i
=
0
for
(
i
=
0
;
i
<
keyLen
;
i
++
)
{
if
(
daoTable
.
rawAttributes
[
keys
[
i
]].
type
&&
daoTable
.
rawAttributes
[
keys
[
i
]].
type
===
"ENUM"
)
{
chainer
.
add
(
self
.
sequelize
,
'query'
,
[
self
.
QueryGenerator
.
pgEnumDrop
(
t
ableName
,
keys
[
i
]),
null
,
{
raw
:
true
}])
chainer
.
add
(
self
.
sequelize
,
'query'
,
[
self
.
QueryGenerator
.
pgEnumDrop
(
getT
ableName
,
keys
[
i
]),
null
,
{
raw
:
true
}])
}
}
}
...
...
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