From 75037bcb28e8370cd5712914ae0bc925c8bad9e9 Mon Sep 17 00:00:00 2001 From: kirrg001 Date: Thu, 3 Jan 2019 17:14:52 +0100 Subject: [PATCH] Added some deprecation notes for x_by fields closes #10286 - we will come up with a new activity stream/actions concept soon --- core/server/api/v0.1/users.js | 1 - core/server/data/importer/importers/data/base.js | 3 +++ core/server/data/schema/schema.js | 5 +++++ core/server/models/base/index.js | 2 ++ 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/core/server/api/v0.1/users.js b/core/server/api/v0.1/users.js index 27b34adb57..8c8fbaa1f3 100644 --- a/core/server/api/v0.1/users.js +++ b/core/server/api/v0.1/users.js @@ -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; diff --git a/core/server/data/importer/importers/data/base.js b/core/server/data/importer/importers/data/base.js index e13b9179db..41787e5f25 100644 --- a/core/server/data/importer/importers/data/base.js +++ b/core/server/data/importer/importers/data/base.js @@ -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([ diff --git a/core/server/data/schema/schema.js b/core/server/data/schema/schema.js index fa5cfb0b57..6b36349e7c 100644 --- a/core/server/data/schema/schema.js +++ b/core/server/data/schema/schema.js @@ -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}, diff --git a/core/server/models/base/index.js b/core/server/models/base/index.js index 773c789184..0845efff33 100644 --- a/core/server/models/base/index.js +++ b/core/server/models/base/index.js @@ -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')) {