Don't try to run schema migrations for SQLite

This commit is contained in:
Luck 2017-11-19 22:24:39 +00:00
parent 6401480874
commit cd0184970a
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B

View File

@ -53,6 +53,7 @@ import me.lucko.luckperms.common.references.UserIdentifier;
import me.lucko.luckperms.common.storage.dao.AbstractDao;
import me.lucko.luckperms.common.storage.dao.legacy.LegacySqlMigration;
import me.lucko.luckperms.common.storage.dao.sql.connection.AbstractConnectionFactory;
import me.lucko.luckperms.common.storage.dao.sql.connection.file.SQLiteConnectionFactory;
import java.io.BufferedReader;
import java.io.InputStream;
@ -197,10 +198,12 @@ public class SqlDao extends AbstractDao {
}
// migrations
try (Connection connection = provider.getConnection()) {
try (Statement s = connection.createStatement()) {
s.execute(prefix.apply("ALTER TABLE {prefix}actions MODIFY COLUMN actor_name VARCHAR(100)"));
s.execute(prefix.apply("ALTER TABLE {prefix}actions MODIFY COLUMN action VARCHAR(300)"));
if (!(provider instanceof SQLiteConnectionFactory)) {
try (Connection connection = provider.getConnection()) {
try (Statement s = connection.createStatement()) {
s.execute(prefix.apply("ALTER TABLE {prefix}actions MODIFY COLUMN actor_name VARCHAR(100)"));
s.execute(prefix.apply("ALTER TABLE {prefix}actions MODIFY COLUMN action VARCHAR(300)"));
}
}
}