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

Commit 2d97a983 by Mick Hansen

test case for primary key autoincrement renameColumn

1 parent 7ab0416f
Showing with 15 additions and 0 deletions
......@@ -207,5 +207,20 @@ describe(Support.getTestDialectTeaser("QueryInterface"), function () {
return self.queryInterface.renameColumn('_Users', 'active', 'enabled')
})
})
it('renames a column primary key autoincrement column', function() {
var self = this
var Fruits = self.sequelize.define('Fruit', {
fruitId: {
type: DataTypes.INTEGER,
allowNull: false,
primaryKey: true,
autoIncrement: true
}
}, { freezeTableName: true })
return Fruits.sync({ force: true }).then(function() {
return self.queryInterface.renameColumn('Fruit', 'fruitId', 'fruit_id')
})
})
})
})
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!