async function hasForeignSQLite({fromTable, fromColumn, toTable, toColumn, transaction = db.knex}) {
    if (!DatabaseInfo.isSQLite(transaction)) {
        throw new errors.InternalServerError({
            message: tpl(messages.hasForeignSQLite3)
        });
    }

    const foreignKeys = await transaction.raw(`PRAGMA foreign_key_list('${fromTable}');`);

    const hasForeignKey = foreignKeys.some(foreignKey => foreignKey.table === toTable && foreignKey.from === fromColumn && foreignKey.to === toColumn);

    return hasForeignKey;
}
Checks if a foreign key exists in a table over the given columns.

@param {Object} configuration - contains all configuration for this function
@param {string} configuration.fromTable - name of the table to add the foreign key to
@param {string} configuration.fromColumn - column of the table to add the foreign key to
@param {string} configuration.toTable - name of the table to point the foreign key to
@param {string} configuration.toColumn - column of the table to point the foreign key to
@param {import('knex').Knex} [configuration.transaction] - connection object containing knex reference