batch/db.clear/db.clear.batch.js
function clearDatabase() {
        var promises = [];

        _.each(resources, function (resource) {
            var service = pancakes.getService(resource.name);
            if (service.removePermanently) {
                log.info('purging ' + resource.name);
                promises.push(service.removePermanently({ where: {}, multi: true }));
            }
        });

        return Q.all(promises);
    }
function clearDatabase() {
        var promises = [];

        _.each(resources, function (resource) {
            var service = pancakes.getService(resource.name);
            if (service.removePermanently) {
                log.info('purging ' + resource.name);
                promises.push(service.removePermanently({ where: {}, multi: true }));
            }
        });

        return Q.all(promises);
    }
function clearDatabase ( ) { var promises = [ ] ; _ . each ( resources , function ( resource ) { var service = pancakes . getService ( resource . name ) ; if ( service . removePermanently ) { log . info ( 'purging ' + resource . name ) ; promises . push ( service . removePermanently ( { where : { } , multi : true } ) ) ; } } ) ; return Q . all ( promises ) ; }
Purge everything in the database
Purge everything in the database