不要怂,就是干,撸起袖子干!

Commit a952b4cf by Mick Hansen

Merge master

2 parents ce6378c6 b1559103
......@@ -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}])
}
}
......
......@@ -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', {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!