Drop ptero_id column from admin table

Fixes a SQLException thrown when adding admins to an older table schema version.
This commit is contained in:
Allink 2023-07-25 18:56:06 +01:00
parent 1251276451
commit 0559e99fb1
No known key found for this signature in database
1 changed files with 9 additions and 0 deletions

View File

@ -90,6 +90,15 @@ public class SQLite extends FreedomService
{
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"))
{