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 a952b4cf
authored
Jan 30, 2014
by
Mick Hansen
Browse files
Options
Browse Files
Download
Plain Diff
Merge master
2 parents
ce6378c6
b1559103
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
1 deletions
lib/query-interface.js
test/postgres/dao.test.js
lib/query-interface.js
View file @
a952b4c
...
...
@@ -216,7 +216,7 @@ module.exports = (function() {
,
i
=
0
for
(
i
=
0
;
i
<
keyLen
;
i
++
)
{
if
(
daoTable
.
rawAttributes
[
keys
[
i
]].
type
&&
daoTable
.
rawAttributes
[
keys
[
i
]].
type
===
"ENUM"
)
{
if
(
daoTable
.
rawAttributes
[
keys
[
i
]].
type
&&
daoTable
.
rawAttributes
[
keys
[
i
]].
type
.
toString
()
===
"ENUM"
)
{
chainer
.
add
(
self
.
sequelize
,
'query'
,
[
self
.
QueryGenerator
.
pgEnumDrop
(
getTableName
,
keys
[
i
]),
null
,
{
logging
:
options
.
logging
,
raw
:
true
}])
}
}
...
...
test/postgres/dao.test.js
View file @
a952b4c
...
...
@@ -80,6 +80,37 @@ if (dialect.match(/^postgres/)) {
})
})
it
(
"should be able to create/drop multiple enums multiple times"
,
function
(
done
)
{
var
DummyModel
=
this
.
sequelize
.
define
(
'Dummy-pg'
,
{
username
:
DataTypes
.
STRING
,
theEnumOne
:
{
type
:
DataTypes
.
ENUM
,
values
:[
'one'
,
'two'
,
'three'
,
]
},
theEnumTwo
:
{
type
:
DataTypes
.
ENUM
,
values
:[
'four'
,
'five'
,
'six'
,
],
}
})
DummyModel
.
sync
({
force
:
true
}).
done
(
function
(
err
)
{
expect
(
err
).
not
.
to
.
be
.
ok
// now sync one more time:
DummyModel
.
sync
({
force
:
true
}).
done
(
function
(
err
)
{
expect
(
err
).
not
.
to
.
be
.
ok
done
();
})
})
})
it
(
'should be able to add enum types'
,
function
(
done
)
{
var
self
=
this
,
User
=
this
.
sequelize
.
define
(
'UserEnums'
,
{
...
...
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