migrate = async (schema0, verbose) => {
  const schema = schema0 || db.connectObj.default_schema;
  //console.log("migrating database schema %s", schema);

  //https://stackoverflow.com/questions/5364928/node-js-require-all-files-in-a-folder
  if (db.is_node) {
    const dbmigrations = new Set(await getMigrationsInDB());
    const files = fs
      .readdirSync(path.join(__dirname, "migrations"))
      .filter(
        (file) =>
          file.match(/\.js$/) !== null &&
          !dbmigrations.has(file.replace(".js", ""))
      );
    if (files.length > 0) {
      for (const file of files) {
        const name = file.replace(".js", "");
        if (!dbmigrations.has(name)) {
          if (verbose)
            console.log("Tenant %s running migration %s", schema0, name);
          const contents = require(path.join(__dirname, "migrations", name));
          await db.withTransaction(async () => {
            if (!is_sqlite) await db.query(`SET search_path TO "${schema}";`);
            await doMigrationStep(name, contents);
          });
        }
      }
    }
  } else {
    for (let [k, v] of Object.entries(window.saltcorn.data.migrations)) {
      await doMigrationStep(k, v, db);
    }
  }
}
Migrate
@param schema0 - schema name
@returns {Promise<void>}