sails.config.modelsYour default, project-wide model settings, conventionally specified in the config/models.js configuration file.
Most of the settings below can also be overridden on a per-model basis—just edit the appropriate model definition file. There are some additional model settings, too, which are not listed below; these can only be specified on a per-model basis. For more details, see Concepts > Model Settings.
| Property | Type | Default | Details |
|---|---|---|---|
attributes |
see Attributes | Default attributes to implicitly include in all of your app's model definitions. (Can be overridden on an attribute-by-attribute basis.) | |
migrate |
see Model Settings | The auto-migration strategy for your Sails app. How & whether Sails will attempt to automatically rebuild the tables/collections/etc. in your schema every time it lifts. | |
schema |
false |
Only relevant for models hooked up to a schemaless database like MongoDB. If set to true, then the ORM will switch into "schemaful" mode. For example, if properties passed in to .create(), .createEach(), or .update() do not correspond to recognized attributes, then they will be stripped out before saving. |
|
datastore |
'default' |
The default datastore configuration any given model will use without a configured override. Avoid changing this. | |
primaryKey |
'id' |
The name of the attribute that every model in your app should use as its primary key by default. Can be overridden here or on a per-model basis, but there's usually a better way. | |
archiveModelIdentity |
'archive' |
The identity of the model to use when calling .archive(). By default this is the Archive model, an implicit model automatically defined by Sails/Waterline. Set to false to disable built-in support for soft-deletes. |