Files
cloudron-box/migrations/20241209150823-archives-add-table.js
Girish Ramakrishnan 41bc08a07e backup: move appConfig to backups table
this is useful for clone also to copy notes, operators, checklist
of the time when the backup was made (as opposed to current)

at this point, it's not clear why we need a archives table. it's
an optimization to not have to store icon for every backup.
2024-12-10 21:04:37 +01:00

20 lines
570 B
JavaScript

'use strict';
exports.up = async function (db) {
const cmd = 'CREATE TABLE archives(' +
'id VARCHAR(128) NOT NULL UNIQUE,' +
'backupId VARCHAR(128) NOT NULL,' +
'creationTime TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,' +
'appStoreIcon MEDIUMBLOB,' +
'icon MEDIUMBLOB,' +
'FOREIGN KEY(backupId) REFERENCES backups(id),' +
'PRIMARY KEY (id)) ' +
'CHARACTER SET utf8 COLLATE utf8_bin';
await db.runSql(cmd);
};
exports.down = async function (db) {
await db.runSql('DROP TABLE archives');
};