Edit Page

sails.config.models

Your 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.

Properties

#
Property Type Default Details
attributes Dictionary 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 String 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 Boolean 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 String 'default' The default datastore configuration any given model will use without a configured override. Avoid changing this.
primaryKey String '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 String _or_ Boolean '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.

Is something missing?

If you notice something we've missed or could be improved on, please follow this link and submit a pull request to the sails repo. Once we merge it, the changes will be reflected on the website the next time it is deployed.

Reference

Reference