mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-14 21:27:23 +01:00
fix(migrations): return to generic state
This commit is contained in:
@@ -17,5 +17,8 @@ function setUpServer () {
|
|||||||
setUpServer();
|
setUpServer();
|
||||||
|
|
||||||
// Replace this with your migration
|
// Replace this with your migration
|
||||||
var processUsers = require('./takeThis');
|
var processUsers = require('./groups/update-groups-with-group-plans');
|
||||||
processUsers();
|
processUsers()
|
||||||
|
.catch(function (err) {
|
||||||
|
console.log(err)
|
||||||
|
})
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
var migrationName = '20170601_takeThis.js'; // Update per month
|
var migrationName = '20170502_takeThis.js'; // Update per month
|
||||||
var authorName = 'Sabe'; // in case script author needs to know when their ...
|
var authorName = 'Sabe'; // in case script author needs to know when their ...
|
||||||
var authorUuid = '7f14ed62-5408-4e1b-be83-ada62d504931'; //... own data is done
|
var authorUuid = '7f14ed62-5408-4e1b-be83-ada62d504931'; //... own data is done
|
||||||
|
|
||||||
@@ -7,14 +7,14 @@ var authorUuid = '7f14ed62-5408-4e1b-be83-ada62d504931'; //... own data is done
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
var monk = require('monk');
|
var monk = require('monk');
|
||||||
var connectionString = 'mongodb://sabrecat:hzpGJTRBn28KBZp@ds013393-a1.mlab.com:13393/habitica?auto_reconnect=true';
|
var connectionString = 'mongodb://localhost:27017/habitrpg?auto_reconnect=true'; // FOR TEST DATABASE
|
||||||
var dbUsers = monk(connectionString).get('users', { castIds: false });
|
var dbUsers = monk(connectionString).get('users', { castIds: false });
|
||||||
|
|
||||||
function processUsers(lastId) {
|
function processUsers(lastId) {
|
||||||
// specify a query to limit the affected users (empty for all users):
|
// specify a query to limit the affected users (empty for all users):
|
||||||
var query = {
|
var query = {
|
||||||
'migration':{$ne:migrationName},
|
'migration':{$ne:migrationName},
|
||||||
'challenges':{$in:['87923188-f298-41ba-95ea-cbfa712ed95b']} // Update per month
|
'challenges':{$in:['69999331-d4ea-45a0-8c3f-f725d22b56c8']} // Update per month
|
||||||
};
|
};
|
||||||
|
|
||||||
if (lastId) {
|
if (lastId) {
|
||||||
|
|||||||
Reference in New Issue
Block a user