Fix backup filename prefix in sql query

This commit is contained in:
Girish Ramakrishnan
2017-01-04 21:41:31 -08:00
parent ceb78f21bb
commit c06bddd19e
+2 -1
View File
@@ -49,8 +49,9 @@ function getByAppIdPaged(page, perPage, appId, callback) {
assert.strictEqual(typeof appId, 'string');
assert.strictEqual(typeof callback, 'function');
// box versions (0.93.x and below) used to use appbackup_ prefix
database.query('SELECT ' + BACKUPS_FIELDS + ' FROM backups WHERE type = ? AND state = ? AND id LIKE ? ORDER BY creationTime DESC LIMIT ?,?',
[ exports.BACKUP_TYPE_APP, exports.BACKUP_STATE_NORMAL, 'appbackup\\_' + appId + '\\_%', (page-1)*perPage, perPage ], function (error, results) {
[ exports.BACKUP_TYPE_APP, exports.BACKUP_STATE_NORMAL, 'app%\\_' + appId + '\\_%', (page-1)*perPage, perPage ], function (error, results) {
if (error) return callback(new DatabaseError(DatabaseError.INTERNAL_ERROR, error));
results.forEach(function (result) { postProcess(result); });