Skip to content

Commit

Permalink
Added some deprecation notes for x_by fields
Browse files Browse the repository at this point in the history
closes #10286

- we will come up with a new activity stream/actions concept soon
  • Loading branch information
kirrg001 committed Jan 3, 2019
1 parent 789a3c0 commit 75037bc
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
1 change: 0 additions & 1 deletion core/server/api/v0.1/users.js
Expand Up @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions core/server/data/importer/importers/data/base.js
Expand Up @@ -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([
Expand Down
5 changes: 5 additions & 0 deletions core/server/data/schema/schema.js
Expand Up @@ -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},
Expand Down
2 changes: 2 additions & 0 deletions core/server/models/base/index.js
Expand Up @@ -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')) {
Expand Down

0 comments on commit 75037bc

Please sign in to comment.