Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Morf requires RELOAD privileges on MySQL which are generally not available in hosted environments #72

Open
badgerwithagun opened this issue Nov 19, 2018 · 1 comment

Comments

@badgerwithagun
Copy link
Member

https://dev.mysql.com/doc/refman/8.0/en/privileges-provided.html#priv_reload

Morf relies on this in MySqlDialect:

  @Override
  public Collection<String> dropStatements(Table table) {
    return Arrays.asList(
      "FLUSH TABLES " + table.getName(),
      "DROP TABLE " + table.getName());
  }

Presumably this is for cluster safety, but it needs to be possible to disable it in environments where the application doesn't own the database, which applies to any shared hosted environment.

@badgerwithagun
Copy link
Member Author

Hacked past this locally with:

  @Override
  public Collection<String> dropStatements(Table table) {
    if ("true".equalsIgnoreCase(System.getProperty("morf.mysql.noadmin"))) {
      return Arrays.asList("DROP TABLE " + table.getName());
    } else {
      return Arrays.asList(
        "FLUSH TABLES " + table.getName(),
        "DROP TABLE " + table.getName());
    }
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant