Many model based aliases has been removed [#9372](https://github.com/sequelize/sequelize/issues/9372)
| Removed in v5 | Official Alternative |
| :------ | :------ |
| insertOrUpdate | upsert |
| find | findOne |
| findAndCount | findAndCountAll |
| findOrInitialize | findOrBuild |
| updateAttributes | update |
| findById, findByPrimary | findByPk |
| all | findAll |
| hook | addHook |
### Datatypes
**Postgres Range**
**Range**
Now supports only one standard format `[{ value: 1, inclusive: true }, { value: 20, inclusive: false }]`[#9364](https://github.com/sequelize/sequelize/pull/9364)
...
...
@@ -59,6 +74,94 @@ Now supports only one standard format `[{ value: 1, inclusive: true }, { value:
Added support for `CIDR`, `INET` and `MACADDR` for Postgres
**Case insensitive text**
Added support for `CITEXT` for Postgres and SQLite
**Removed**
`NONE` type has been removed, use `VIRTUAL` instead
### Hooks
**Removed aliases**
Hooks aliases has been removed [#9372](https://github.com/sequelize/sequelize/issues/9372)
[sequelize.Op.and]:[// Using sequelize.Op or Sequelize.Op interchangeably
{
name:"Abc"
},
{
age:{
[Sequelize.Op.gte]:18
}
}
]
}
}).catch(sequelize.ConnectionError,()=>{
console.error('Something wrong with connection?');
});
/**
* In v5 aliases has been removed from Sequelize prototype
* You should use Sequelize directly to access Op, Errors etc
*/
Model.findAll({
where:{
[Sequelize.Op.and]:[// Dont use sequelize.Op, use Sequelize.Op instead
{
name:"Abc"
},
{
age:{
[Sequelize.Op.gte]:18
}
}
]
}
}).catch(Sequelize.ConnectionError,()=>{
console.error('Something wrong with connection?');
});
```
### Query Interface
-`changeColumn` no longer generates constraint with `_idx` suffix. Now Sequelize does not specify any name for constraints thus defaulting to database engine naming. This aligns behavior of `sync`, `createTable` and `changeColumn`.
...
...
@@ -68,7 +171,7 @@ Added support for `CIDR`, `INET` and `MACADDR` for Postgres
- Sequelize now use parameterized queries for all INSERT / UPDATE operations (except UPSERT). They provide better protection against SQL Injection attack.
-`ValidationErrorItem` now holds reference to original error in the `original` property, rather than the `__raw` property.
-[retry-as-promised](https://github.com/mickhansen/retry-as-promised) has been updated to `3.0.0`, which use [any-promise](https://github.com/kevinbeaty/any-promise). This module repeat all `sequelize.query` operations. You can configure `any-promise` to use `bluebird` for better performance on Node 4 or 6
- Sequelize will ignore all `undefined` keys in `where` options, In past versions `undefined` was converted to `null`. For `BULKUPDATE / BULKDELETE` query types passing undefined keys in where options will throw an error.
- Sequelize will throw for all `undefined` keys in `where` options, In past versions `undefined` was converted to `null`.
### Packages
...
...
@@ -78,6 +181,40 @@ Added support for `CIDR`, `INET` and `MACADDR` for Postgres
## Changelog
### 5.0.0-beta.13
- fix: throw on undefined where parameters [#10048](https://github.com/sequelize/sequelize/pull/10048)
- fix(model): improve wrong alias error message [#10041](https://github.com/sequelize/sequelize/pull/10041)