archives: use separate table
Cleaner to separate things from the backups table. * icon, appConfig, appStoreIcon etc are only valid for archives * older version cloudron does not have appConfig in backups table (so it cannot be an archive entry)
This commit is contained in:
@@ -146,6 +146,7 @@ exports = module.exports = {
|
||||
|
||||
const appstore = require('./appstore.js'),
|
||||
appTaskManager = require('./apptaskmanager.js'),
|
||||
archives = require('./archives.js'),
|
||||
assert = require('assert'),
|
||||
backups = require('./backups.js'),
|
||||
BoxError = require('./boxerror.js'),
|
||||
@@ -2496,8 +2497,7 @@ async function archive(app, backupId, auditSource) {
|
||||
|
||||
const icons = await getIcons(app.id);
|
||||
const { taskId } = await uninstall(app, auditSource);
|
||||
await backups.update(result[0].id, { archive: true, icon: icons.icon, appStoreIcon: icons.appStoreIcon });
|
||||
if (!result[0].appConfig) await backups.update(result[0].id, { appConfig: app }); // workaround for previous versions not setting appConfig
|
||||
await archives.add(backupId, { icon: icons.icon, appStoreIcon: icons.appStoreIcon, appConfig: app });
|
||||
return { taskId };
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user