Fix a exception being thrown and crashing the server

This commit is contained in:
zontreck 2024-04-30 15:24:29 -07:00
parent bd15d1f244
commit 0d735ec2e8
2 changed files with 3 additions and 2 deletions

View file

@ -66,7 +66,7 @@ public class DatabaseMigrations
try {
DatabaseWrapper.get().executePreparedStatement(pstmt);
} catch (SQLException e) {
throw new RuntimeException(e);
LibZontreck.LOGGER.warn("There was a problem executing a migration. The migration is " + pstmt+"\n\nThis does not necessarily mean a failure. If everything seems to work fine, this migration might not have been necessary.");
}
}
@ -159,6 +159,7 @@ public class DatabaseMigrations
Migration lastTableChecked = null;
for(Migration m : migrations)
{
if(lastTableChecked == null) lastTableChecked = getCurrentTable(m.tableID);
else {
if(lastTableChecked.tableID != m.tableID) lastTableChecked = getCurrentTable(m.tableID);