Skip to content

Commit

Permalink
Merge pull request balderdashy#7181 from balderdashy/update-upgrading…
Browse files Browse the repository at this point in the history
…-to-1.0-docs

[misc] Add note about undefined attributes to upgrading docs
  • Loading branch information
eashaw committed Oct 12, 2021
2 parents 799f2c0 + 39e34cd commit 15b43ff
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions docs/upgrading/To1.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ The upgrade guide above provides for the most common upgrade issues that Sails c
* **The experimental `.validate()` method in model classes** (e.g. `User.validate()`) is now fully supported, but its usage has changed. See the [`.validate()` docs](https://sailsjs.com/documentation/reference/waterline-orm/models/validate) for more information.
* **The ordering of attributes** in the internal representation of model classes has changed (association attributes are now sorted at the bottom). This has the effect of causing tables created using `migrate: 'alter'` to have their columns in a different order than in previous versions of Waterline, so be aware of this if column ordering is important in your application. As a reminder, auto-migrations are intended to help you design your schema as you build your app. They are not guaranteed to be consistent regarding any details of your physical database columns besides setting the column name, type (including character set / encoding if specified) and uniqueness.
* **Using `_config` to link a controller to a model** will no longer work. This was never a supported feature, but it was used in some projects to change the URLs that were mapped to the blueprint actions for a model. Please use [`restPrefix`](https://sailsjs.com/documentation/reference/configuration/sails-config-blueprints#?properties) instead.
* **The `find()`, `destroy()`, and `update()` methods** ignore `undefined` attributes. These methods will strip undefined attributes from their search criteria, e.g. `User.update({id: undefined}).with({ firstName: 'Finn'})` would update **every** user record. Read more about this in [this Github issue](https://github.com/balderdashy/sails/issues/4639#issuecomment-320369193)

### Changes to database configuration

Expand Down

0 comments on commit 15b43ff

Please sign in to comment.