fixed paths in upgrade scripts

v1.18.x
Julian Lam 8 years ago
parent e309175989
commit f0059ec723

@ -2,7 +2,7 @@
'use strict';
var db = require('../database');
var db = require('../../database');
var async = require('async');

@ -2,7 +2,7 @@
'use strict';
var db = require('../database');
var db = require('../../database');
var async = require('async');
var winston = require('winston');

@ -8,7 +8,7 @@ module.exports = {
name: 'Creating Global moderators group',
timestamp: Date.UTC(2016, 0, 23),
method: function (callback) {
var groups = require('../groups');
var groups = require('../../groups');
async.waterfall([
function (next) {
groups.exists('Global Moderators', next);

@ -2,7 +2,7 @@
'use strict';
var db = require('../database');
var db = require('../../database');
var async = require('async');
@ -10,7 +10,7 @@ module.exports = {
name: 'Social: Post Sharing',
timestamp: Date.UTC(2016, 1, 25),
method: function (callback) {
var social = require('../social');
var social = require('../../social');
async.parallel([
function (next) {
social.setActivePostSharingNetworks(['facebook', 'google', 'twitter'], next);

@ -2,7 +2,7 @@
'use strict';
var db = require('../database');
var db = require('../../database');
var async = require('async');

@ -2,7 +2,7 @@
'use strict';
var db = require('../database');
var db = require('../../database');
var async = require('async');
var winston = require('winston');
@ -11,7 +11,7 @@ module.exports = {
name: 'Creating user best post sorted sets',
timestamp: Date.UTC(2016, 0, 14),
method: function (callback) {
var batch = require('../batch');
var batch = require('../../batch');
batch.processSortedSet('posts:pid', function (ids, next) {
async.eachSeries(ids, function (id, next) {

@ -2,7 +2,7 @@
'use strict';
var db = require('../database');
var db = require('../../database');
var async = require('async');
var winston = require('winston');
@ -11,7 +11,7 @@ module.exports = {
name: 'Creating users:notvalidated',
timestamp: Date.UTC(2016, 0, 20),
method: function (callback) {
var batch = require('../batch');
var batch = require('../../batch');
var now = Date.now();
batch.processSortedSet('users:joindate', function (ids, next) {
async.eachSeries(ids, function (id, next) {

@ -2,7 +2,7 @@
'use strict';
var db = require('../database');
var db = require('../../database');
var async = require('async');
var winston = require('winston');
@ -11,8 +11,8 @@ module.exports = {
name: 'Giving topics:read privs to any group that was previously allowed to Find & Access Category',
timestamp: Date.UTC(2016, 4, 28),
method: function (callback) {
var groupsAPI = require('../groups');
var privilegesAPI = require('../privileges');
var groupsAPI = require('../../groups');
var privilegesAPI = require('../../privileges');
db.getSortedSetRange('categories:cid', 0, -1, function (err, cids) {
if (err) {

@ -2,7 +2,7 @@
'use strict';
var db = require('../database');
var db = require('../../database');
var async = require('async');
var winston = require('winston');
@ -11,8 +11,8 @@ module.exports = {
name: 'Dismiss flags from deleted topics',
timestamp: Date.UTC(2016, 3, 29),
method: function (callback) {
var posts = require('../posts');
var topics = require('../topics');
var posts = require('../../posts');
var topics = require('../../topics');
var pids;
var tids;

@ -2,7 +2,7 @@
'use strict';
var db = require('../database');
var db = require('../../database');
var async = require('async');
var winston = require('winston');
@ -11,8 +11,8 @@ module.exports = {
name: 'Group title from settings to user profile',
timestamp: Date.UTC(2016, 3, 14),
method: function (callback) {
var user = require('../user');
var batch = require('../batch');
var user = require('../../user');
var batch = require('../../batch');
var count = 0;
batch.processSortedSet('users:joindate', function (uids, next) {
winston.verbose('upgraded ' + count + ' users');

@ -2,7 +2,7 @@
'use strict';
var db = require('../database');
var db = require('../../database');
var async = require('async');
var winston = require('winston');
@ -11,8 +11,8 @@ module.exports = {
name: 'Store upvotes/downvotes separately',
timestamp: Date.UTC(2016, 5, 13),
method: function (callback) {
var batch = require('../batch');
var posts = require('../posts');
var batch = require('../../batch');
var posts = require('../../posts');
var count = 0;
batch.processSortedSet('posts:pid', function (pids, next) {
winston.verbose('upgraded ' + count + ' posts');

@ -2,7 +2,7 @@
'use strict';
var db = require('../database');
var db = require('../../database');
var async = require('async');
var winston = require('winston');
@ -11,8 +11,8 @@ module.exports = {
name: 'Users post count per tid',
timestamp: Date.UTC(2016, 3, 19),
method: function (callback) {
var batch = require('../batch');
var topics = require('../topics');
var batch = require('../../batch');
var topics = require('../../topics');
var count = 0;
batch.processSortedSet('topics:tid', function (tids, next) {
winston.verbose('upgraded ' + count + ' topics');

@ -2,7 +2,7 @@
'use strict';
var db = require('../database');
var db = require('../../database');
var async = require('async');
var winston = require('winston');
@ -11,7 +11,7 @@ module.exports = {
name: 'Removing best posts with negative scores',
timestamp: Date.UTC(2016, 7, 5),
method: function (callback) {
var batch = require('../batch');
var batch = require('../../batch');
batch.processSortedSet('users:joindate', function (ids, next) {
async.each(ids, function (id, next) {
winston.verbose('processing uid ' + id);

@ -2,7 +2,7 @@
'use strict';
var db = require('../database');
var db = require('../../database');
var async = require('async');
@ -10,8 +10,8 @@ module.exports = {
name: 'Giving upload privileges',
timestamp: Date.UTC(2016, 6, 12),
method: function (callback) {
var privilegesAPI = require('../privileges');
var meta = require('../meta');
var privilegesAPI = require('../../privileges');
var meta = require('../../meta');
db.getSortedSetRange('categories:cid', 0, -1, function (err, cids) {
if (err) {

@ -2,7 +2,7 @@
'use strict';
var db = require('../database');
var db = require('../../database');
var async = require('async');

@ -2,7 +2,7 @@
'use strict';
var db = require('../database');
var db = require('../../database');
var async = require('async');
var winston = require('winston');
@ -11,8 +11,8 @@ module.exports = {
name: 'Granting edit/delete/delete topic on existing categories',
timestamp: Date.UTC(2016, 7, 7),
method: function (callback) {
var groupsAPI = require('../groups');
var privilegesAPI = require('../privileges');
var groupsAPI = require('../../groups');
var privilegesAPI = require('../../privileges');
db.getSortedSetRange('categories:cid', 0, -1, function (err, cids) {
if (err) {

@ -2,7 +2,7 @@
'use strict';
var db = require('../database');
var db = require('../../database');
var async = require('async');
@ -11,7 +11,7 @@ module.exports = {
timestamp: Date.UTC(2016, 9, 8),
method: function (callback) {
function upgradePosts(next) {
var batch = require('../batch');
var batch = require('../../batch');
batch.processSortedSet('posts:pid', function (ids, next) {
async.each(ids, function (id, next) {
@ -38,7 +38,7 @@ module.exports = {
}
function upgradeUsers(next) {
var batch = require('../batch');
var batch = require('../../batch');
batch.processSortedSet('users:joindate', function (ids, next) {
async.each(ids, function (id, next) {

@ -2,7 +2,7 @@
'use strict';
var db = require('../database');
var db = require('../../database');
var async = require('async');
var winston = require('winston');
@ -11,8 +11,8 @@ module.exports = {
name: 'Sorted sets for post replies',
timestamp: Date.UTC(2016, 9, 14),
method: function (callback) {
var posts = require('../posts');
var batch = require('../batch');
var posts = require('../../posts');
var batch = require('../../batch');
batch.processSortedSet('posts:pid', function (ids, next) {
posts.getPostsFields(ids, ['pid', 'toPid', 'timestamp'], function (err, data) {
if (err) {

@ -2,7 +2,7 @@
'use strict';
var db = require('../database');
var db = require('../../database');
var async = require('async');
@ -10,9 +10,9 @@ module.exports = {
name: 'Update global and user language keys',
timestamp: Date.UTC(2016, 10, 22),
method: function (callback) {
var user = require('../user');
var meta = require('../meta');
var batch = require('../batch');
var user = require('../../user');
var meta = require('../../meta');
var batch = require('../../batch');
var newLanguage;
async.parallel([
function (next) {

@ -2,7 +2,7 @@
'use strict';
var db = require('../database');
var db = require('../../database');
var async = require('async');
var winston = require('winston');
@ -11,8 +11,8 @@ module.exports = {
name: 'Sorted set for pinned topics',
timestamp: Date.UTC(2016, 10, 25),
method: function (callback) {
var topics = require('../topics');
var batch = require('../batch');
var topics = require('../../topics');
var batch = require('../../batch');
batch.processSortedSet('topics:tid', function (ids, next) {
topics.getTopicsFields(ids, ['tid', 'cid', 'pinned', 'lastposttime'], function (err, data) {
if (err) {

@ -2,7 +2,7 @@
'use strict';
var db = require('../database');
var db = require('../../database');
var async = require('async');

@ -2,7 +2,7 @@
'use strict';
var db = require('../database');
var db = require('../../database');
var async = require('async');
@ -10,8 +10,8 @@ module.exports = {
name: 'Update global and user sound settings',
timestamp: Date.UTC(2017, 1, 25),
method: function (callback) {
var meta = require('../meta');
var batch = require('../batch');
var meta = require('../../meta');
var batch = require('../../batch');
var map = {
'notification.mp3': 'Default | Deedle-dum',

@ -2,7 +2,7 @@
'use strict';
var db = require('../database');
var db = require('../../database');
var async = require('async');
@ -10,9 +10,9 @@ module.exports = {
name: 'Migrating flags to new schema',
timestamp: Date.UTC(2016, 11, 7),
method: function (callback) {
var batch = require('../batch');
var posts = require('../posts');
var flags = require('../flags');
var batch = require('../../batch');
var posts = require('../../posts');
var flags = require('../../flags');
batch.processSortedSet('posts:pid', function (ids, next) {
posts.getPostsByPids(ids, 1, function (err, posts) {

@ -2,7 +2,7 @@
'use strict';
var db = require('../database');
var db = require('../../database');
var async = require('async');
@ -10,7 +10,7 @@ module.exports = {
name: 'New sorted set posts:votes',
timestamp: Date.UTC(2017, 1, 27),
method: function (callback) {
require('../batch').processSortedSet('posts:pid', function (pids, next) {
require('../../batch').processSortedSet('posts:pid', function (pids, next) {
async.each(pids, function (pid, next) {
db.getObjectFields('post:' + pid, ['upvotes', 'downvotes'], function (err, postData) {
if (err || !postData) {

@ -2,7 +2,7 @@
'use strict';
var db = require('../database');
var db = require('../../database');
var async = require('async');
var winston = require('winston');

Loading…
Cancel
Save