Added some deprecation notes for x_by fields

closes #10286

- we will come up with a new activity stream/actions concept soon
This commit is contained in:
kirrg001 2019-01-03 17:14:52 +01:00
parent 789a3c0715
commit 75037bcb28
4 changed files with 10 additions and 1 deletions

View File

@ -9,7 +9,6 @@ const Promise = require('bluebird'),
common = require('../../lib/common'),
{urlsForUser} = require('./decorators/urls'),
docName = 'users',
// TODO: implement created_by, updated_by
allowedIncludes = ['count.posts', 'permissions', 'roles', 'roles.permissions'];
let users;

View File

@ -272,6 +272,9 @@ class Base {
}
};
/**
* @deprecated: x_by fields (https://github.com/TryGhost/Ghost/issues/10286)
*/
// Iterate over all possible user relations
_.each(this.dataToImport, (obj) => {
_.each([

View File

@ -37,6 +37,11 @@ module.exports = {
*/
author_id: {type: 'string', maxlength: 24, nullable: false},
created_at: {type: 'dateTime', nullable: false},
/**
* @deprecated: https://github.com/TryGhost/Ghost/issues/10286
*
* This is valid for all x_by fields.
*/
created_by: {type: 'string', maxlength: 24, nullable: false},
updated_at: {type: 'dateTime', nullable: true},
updated_by: {type: 'string', maxlength: 24, nullable: true},

View File

@ -279,6 +279,8 @@ ghostBookshelf.Model = ghostBookshelf.Model.extend({
* - importing data
* - internal context
* - if no context
*
* @deprecated: x_by fields (https://github.com/TryGhost/Ghost/issues/10286)
*/
onUpdating: function onUpdating(newObj, attr, options) {
if (schema.tables[this.tableName].hasOwnProperty('updated_by')) {