Changeset 525 for Dev/trunk/src/server/bin/upgrade-db-1-to-2.js
- Timestamp:
- 03/19/14 21:33:13 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/trunk/src/server/bin/upgrade-db-1-to-2.js
r487 r525 1 1 var env = require('../env') 2 , HTTPResult = require('../util/http-result') 2 3 , upgradeCouch = require('../config/upgrade-couchdb') 3 4 , cryptoken = require('../util/crypto-token') 4 , Q = require('q')5 5 ; 6 6 upgradeCouch(env.couchServerURL,env.dbName,function(doc){ 7 if ( (doc.type === 'Response' || doc.type === 'SurveyRun') && !doc.secret ) { 8 return cryptoken(8).then(function(token){ 7 if ( (doc.type === 'Response' || doc.type === 'SurveyRun') && 8 !doc.secret ) { 9 return cryptoken() 10 .then(function(token){ 9 11 doc.secret = token; 10 12 return doc; 11 13 }); 12 14 } else { 13 return Q.reject();15 return new HTTPResult(-1); 14 16 } 15 17 }).then(function(res){
Note: See TracChangeset
for help on using the changeset viewer.