Wrap unimportant sql migrations in try..catch (#755)
This commit is contained in:
parent
b8c5c60ece
commit
4fda89d5c8
@ -205,15 +205,20 @@ public class SqlDao extends AbstractDao {
|
||||
}
|
||||
|
||||
// migrations
|
||||
if (!(this.provider instanceof SQLiteConnectionFactory) && !(this.provider instanceof PostgreConnectionFactory)) {
|
||||
try (Connection connection = this.provider.getConnection()) {
|
||||
try (Statement s = connection.createStatement()) {
|
||||
s.execute(this.prefix.apply("ALTER TABLE {prefix}actions MODIFY COLUMN actor_name VARCHAR(100)"));
|
||||
s.execute(this.prefix.apply("ALTER TABLE {prefix}actions MODIFY COLUMN action VARCHAR(300)"));
|
||||
try {
|
||||
if (!(this.provider instanceof SQLiteConnectionFactory) && !(this.provider instanceof PostgreConnectionFactory)) {
|
||||
try (Connection connection = this.provider.getConnection()) {
|
||||
try (Statement s = connection.createStatement()) {
|
||||
s.execute(this.prefix.apply("ALTER TABLE {prefix}actions MODIFY COLUMN actor_name VARCHAR(100)"));
|
||||
s.execute(this.prefix.apply("ALTER TABLE {prefix}actions MODIFY COLUMN action VARCHAR(300)"));
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
} catch (Exception e) {
|
||||
this.plugin.getLog().severe("Error occurred whilst initialising the database.");
|
||||
e.printStackTrace();
|
||||
|
Loading…
Reference in New Issue
Block a user