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.
20 lines
570 B
JavaScript
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');
|
|
};
|