Sets table storage engine to be explicitly InnoDB for MySQL

https://github.com/BentoBoxWorld/BentoBox/issues/934
This commit is contained in:
tastybento 2019-09-07 11:14:20 -07:00
parent 1406534266
commit 94cb0fb188

View File

@ -23,6 +23,8 @@ public class MySQLDatabaseHandler<T> extends SQLDatabaseHandler<T> {
* @param dbConnecter - authentication details for the database
*/
MySQLDatabaseHandler(BentoBox plugin, Class<T> type, DatabaseConnector dbConnecter) {
super(plugin, type, dbConnecter, new SQLConfiguration(type.getCanonicalName()));
super(plugin, type, dbConnecter, new SQLConfiguration(type.getCanonicalName())
.schema("CREATE TABLE IF NOT EXISTS `" + type.getCanonicalName() +
"` (json JSON, uniqueId VARCHAR(255) GENERATED ALWAYS AS (json->\"$.uniqueId\"), UNIQUE INDEX i (uniqueId) ) ENGINE = INNODB"));
}
}