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