'use strict';

exports.up = async function (db) {
    // InnoDB has a strict maximum index key length. utf8mb8 (next migration) means 1024*4=4096. max in our db is 3072
    await db.runSql('UPDATE volumes SET hostPath=LEFT(hostPath, 768)');
    await db.runSql('ALTER TABLE volumes MODIFY hostPath VARCHAR(768) NOT NULL UNIQUE');
};

exports.down = async function (db) {
    await db.runSql('ALTER TABLE tasks DROP COLUMN pending');
};
