mirror of
https://github.com/plankanban/planka.git
synced 2025-07-24 15:49:46 +02:00
Code formatting with prettier, change eslint config for the server
This commit is contained in:
parent
b7f37f0f96
commit
a11f6260c0
191 changed files with 4321 additions and 2880 deletions
|
@ -14,55 +14,55 @@
|
|||
*/
|
||||
|
||||
module.exports.models = {
|
||||
/***************************************************************************
|
||||
* *
|
||||
* Whether model methods like `.create()` and `.update()` should ignore *
|
||||
* (and refuse to persist) unrecognized data-- i.e. properties other than *
|
||||
* those explicitly defined by attributes in the model definition. *
|
||||
* *
|
||||
* To ease future maintenance of your code base, it is usually a good idea *
|
||||
* to set this to `true`. *
|
||||
* *
|
||||
* > Note that `schema: false` is not supported by every database. *
|
||||
* > For example, if you are using a SQL database, then relevant models *
|
||||
* > are always effectively `schema: true`. And if no `schema` setting is *
|
||||
* > provided whatsoever, the behavior is left up to the database adapter. *
|
||||
* > *
|
||||
* > For more info, see: *
|
||||
* > https://sailsjs.com/docs/concepts/orm/model-settings#?schema *
|
||||
* *
|
||||
***************************************************************************/
|
||||
/**
|
||||
*
|
||||
* Whether model methods like `.create()` and `.update()` should ignore
|
||||
* (and refuse to persist) unrecognized data-- i.e. properties other than
|
||||
* those explicitly defined by attributes in the model definition.
|
||||
*
|
||||
* To ease future maintenance of your code base, it is usually a good idea
|
||||
* to set this to `true`.
|
||||
*
|
||||
* > Note that `schema: false` is not supported by every database.
|
||||
* > For example, if you are using a SQL database, then relevant models
|
||||
* > are always effectively `schema: true`. And if no `schema` setting is
|
||||
* > provided whatsoever, the behavior is left up to the database adapter.
|
||||
* >
|
||||
* > For more info, see:
|
||||
* > https://sailsjs.com/docs/concepts/orm/model-settings#?schema
|
||||
*
|
||||
*/
|
||||
|
||||
// schema: true,
|
||||
|
||||
/***************************************************************************
|
||||
* *
|
||||
* How and whether Sails will attempt to automatically rebuild the *
|
||||
* tables/collections/etc. in your schema. *
|
||||
* *
|
||||
* > Note that, when running in a production environment, this will be *
|
||||
* > automatically set to `migrate: 'safe'`, no matter what you configure *
|
||||
* > here. This is a failsafe to prevent Sails from accidentally running *
|
||||
* > auto-migrations on your production database. *
|
||||
* > *
|
||||
* > For more info, see: *
|
||||
* > https://sailsjs.com/docs/concepts/orm/model-settings#?migrate *
|
||||
* *
|
||||
***************************************************************************/
|
||||
/**
|
||||
*
|
||||
* How and whether Sails will attempt to automatically rebuild the
|
||||
* tables/collections/etc. in your schema.
|
||||
*
|
||||
* > Note that, when running in a production environment, this will be
|
||||
* > automatically set to `migrate: 'safe'`, no matter what you configure
|
||||
* > here. This is a failsafe to prevent Sails from accidentally running
|
||||
* > auto-migrations on your production database.
|
||||
* >
|
||||
* > For more info, see:
|
||||
* > https://sailsjs.com/docs/concepts/orm/model-settings#?migrate
|
||||
*
|
||||
*/
|
||||
|
||||
migrate: 'safe',
|
||||
|
||||
/***************************************************************************
|
||||
* *
|
||||
* Base attributes that are included in all of your models by default. *
|
||||
* By convention, this is your primary key attribute (`id`), as well as two *
|
||||
* other timestamp attributes for tracking when records were last created *
|
||||
* or updated. *
|
||||
* *
|
||||
* > For more info, see: *
|
||||
* > https://sailsjs.com/docs/concepts/orm/model-settings#?attributes *
|
||||
* *
|
||||
***************************************************************************/
|
||||
/**
|
||||
*
|
||||
* Base attributes that are included in all of your models by default.
|
||||
* By convention, this is your primary key attribute (`id`), as well as two
|
||||
* other timestamp attributes for tracking when records were last created
|
||||
* or updated.
|
||||
*
|
||||
* > For more info, see:
|
||||
* > https://sailsjs.com/docs/concepts/orm/model-settings#?attributes
|
||||
*
|
||||
*/
|
||||
|
||||
attributes: {
|
||||
id: {
|
||||
|
@ -77,62 +77,50 @@ module.exports.models = {
|
|||
type: 'ref',
|
||||
columnName: 'updated_at',
|
||||
},
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// /\ Using MongoDB?
|
||||
// || Replace `id` above with this instead:
|
||||
//
|
||||
// ```
|
||||
// id: { type: 'string', columnName: '_id' },
|
||||
// ```
|
||||
//
|
||||
// Plus, don't forget to configure MongoDB as your default datastore:
|
||||
// https://sailsjs.com/docs/tutorials/using-mongo-db
|
||||
//--------------------------------------------------------------------------
|
||||
},
|
||||
|
||||
beforeCreate: function(valuesToSet, proceed) {
|
||||
beforeCreate(valuesToSet, proceed) {
|
||||
valuesToSet.createdAt = new Date().toUTCString();
|
||||
|
||||
proceed();
|
||||
},
|
||||
|
||||
beforeUpdate: function(valuesToSet, proceed) {
|
||||
beforeUpdate(valuesToSet, proceed) {
|
||||
valuesToSet.updatedAt = new Date().toUTCString();
|
||||
|
||||
proceed();
|
||||
},
|
||||
|
||||
/******************************************************************************
|
||||
* *
|
||||
* The set of DEKs (data encryption keys) for at-rest encryption. *
|
||||
* i.e. when encrypting/decrypting data for attributes with `encrypt: true`. *
|
||||
* *
|
||||
* > The `default` DEK is used for all new encryptions, but multiple DEKs *
|
||||
* > can be configured to allow for key rotation. In production, be sure to *
|
||||
* > manage these keys like you would any other sensitive credential. *
|
||||
* *
|
||||
* > For more info, see: *
|
||||
* > https://sailsjs.com/docs/concepts/orm/model-settings#?dataEncryptionKeys *
|
||||
* *
|
||||
******************************************************************************/
|
||||
/**
|
||||
*
|
||||
* The set of DEKs (data encryption keys) for at-rest encryption.
|
||||
* i.e. when encrypting/decrypting data for attributes with `encrypt: true`.
|
||||
*
|
||||
* > The `default` DEK is used for all new encryptions, but multiple DEKs
|
||||
* > can be configured to allow for key rotation. In production, be sure to
|
||||
* > manage these keys like you would any other sensitive credential.
|
||||
*
|
||||
* > For more info, see:
|
||||
* > https://sailsjs.com/docs/concepts/orm/model-settings#?dataEncryptionKeys
|
||||
*
|
||||
*/
|
||||
|
||||
dataEncryptionKeys: {
|
||||
default: 'fKSf/hPekelUegjM7IyM/EhHbd7HI9Kiec5Lxy2t+7w=',
|
||||
},
|
||||
|
||||
/***************************************************************************
|
||||
* *
|
||||
* Whether or not implicit records for associations should be cleaned up *
|
||||
* automatically using the built-in polyfill. This is especially useful *
|
||||
* during development with sails-disk. *
|
||||
* *
|
||||
* Depending on which databases you're using, you may want to disable this *
|
||||
* polyfill in your production environment. *
|
||||
* *
|
||||
* (For production configuration, see `config/env/production.js`.) *
|
||||
* *
|
||||
***************************************************************************/
|
||||
/**
|
||||
*
|
||||
* Whether or not implicit records for associations should be cleaned up
|
||||
* automatically using the built-in polyfill. This is especially useful
|
||||
* during development with sails-disk.
|
||||
*
|
||||
* Depending on which databases you're using, you may want to disable this
|
||||
* polyfill in your production environment.
|
||||
*
|
||||
* (For production configuration, see `config/env/production.js`.)
|
||||
*
|
||||
*/
|
||||
|
||||
// cascadeOnDestroy: true,
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue