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

Commit b580d802 by Sushant Committed by Jan Aagaard Meier

corrected oid for range Int4 (#6220)

Conflicts:
	changelog.md
1 parent 37e6e63f
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
- [FIXED] Don't patch `validator` library globally [#6196](https://github.com/sequelize/sequelize/issues/6196) - [FIXED] Don't patch `validator` library globally [#6196](https://github.com/sequelize/sequelize/issues/6196)
- [CHANGED] `ignore` for create was renamed to `ignoreDuplicates` [#6138](https://github.com/sequelize/sequelize/issues/6138) - [CHANGED] `ignore` for create was renamed to `ignoreDuplicates` [#6138](https://github.com/sequelize/sequelize/issues/6138)
- [FIXED] Index names not quoted properly in `removeIndex` [#5888](https://github.com/sequelize/sequelize/issues/5888) - [FIXED] Index names not quoted properly in `removeIndex` [#5888](https://github.com/sequelize/sequelize/issues/5888)
- [FIXED] `Int4` range not properly parsed [#5747](https://github.com/sequelize/sequelize/issues/5747)
## BC breaks: ## BC breaks:
- Range type bounds now default to [postgres default](https://www.postgresql.org/docs/9.5/static/rangetypes.html#RANGETYPES-CONSTRUCT) `[)` (inclusive, exclusive), previously was `()` (exclusive, exclusive) - Range type bounds now default to [postgres default](https://www.postgresql.org/docs/9.5/static/rangetypes.html#RANGETYPES-CONSTRUCT) `[)` (inclusive, exclusive), previously was `()` (exclusive, exclusive)
......
...@@ -386,7 +386,7 @@ module.exports = BaseTypes => { ...@@ -386,7 +386,7 @@ module.exports = BaseTypes => {
inherits(RANGE, BaseTypes.RANGE); inherits(RANGE, BaseTypes.RANGE);
RANGE.oid_map = { RANGE.oid_map = {
3904: 1007, // int4 3904: 23, // int4
3905: 1007, 3905: 1007,
3906: 1700, // Numeric 3906: 1700, // Numeric
3907: 1700, 3907: 1700,
......
...@@ -362,6 +362,24 @@ describe(Support.getTestDialectTeaser('DataTypes'), function() { ...@@ -362,6 +362,24 @@ describe(Support.getTestDialectTeaser('DataTypes'), function() {
expect(user.get('decimalWithFloatParser')).to.be.eql('0.12345678'); expect(user.get('decimalWithFloatParser')).to.be.eql('0.12345678');
}); });
}); });
it('should return Int4 range properly #5747', function() {
var Model = this.sequelize.define('M', {
interval: {
type: Sequelize.RANGE(Sequelize.INTEGER),
allowNull: false,
unique: true
}
});
return Model.sync({ force: true })
.then(() => Model.create({ interval: [1,4] }) )
.then(() => Model.findAll() )
.spread((m) => {
expect(m.interval[0]).to.be.eql(1);
expect(m.interval[1]).to.be.eql(4);
});
});
} }
if (dialect === 'mysql') { if (dialect === 'mysql') {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!