'use strict';

exports.up = async function(db) {
    await db.runSql('ALTER TABLE backups ADD COLUMN integrityCheckTaskId INTEGER');
    await db.runSql('ALTER TABLE backups ADD COLUMN integrityCheckStatus VARCHAR(16)');
    await db.runSql('ALTER TABLE backups ADD COLUMN integrityCheckResultJson TEXT');
    await db.runSql('ALTER TABLE backups ADD COLUMN lastIntegrityCheckTime TIMESTAMP NULL');
    await db.runSql('ALTER TABLE backups ADD FOREIGN KEY(integrityCheckTaskId) REFERENCES tasks(id)');
};

exports.down = async function(db) {
    await db.runSql('ALTER TABLE backups DROP COLUMN integrityCheckTaskId, DROP COLUMN lastIntegrityCheckTime, DROP COLUMN integrityCheckStatus, DROP COLUMN integrityCheckResultJson');
};
