Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
Drop ptero_id column from admin table
Browse files Browse the repository at this point in the history
Fixes a SQLException thrown when adding admins to an older table schema version.
  • Loading branch information
Allink committed Jul 25, 2023
1 parent 1251276 commit 0559e99
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/main/java/me/totalfreedom/totalfreedommod/sql/SQLite.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,15 @@ public void checkTables()
{
FLog.severe("Failed to create the admins table: " + e.getMessage());
}
} else
{
try
{
connection.createStatement().execute("ALTER TABLE `admins` DROP COLUMN `ptero_id`");
} catch (SQLException e)
{
// Ignore the error. If someone else wants to add WORKING AND TESTED CODE to check if the `ptero_id` column exists, they can, but I couldn't find a good way.
}
}
if (tableExists(meta, "players"))
{
Expand Down

0 comments on commit 0559e99

Please sign in to comment.