Class DatabaseMigrations

java.lang.Object
com.soulfiremc.server.database.DatabaseMigrations

public final class DatabaseMigrations extends Object
Handles database migrations that need to run before Hibernate initializes. These migrations handle schema changes that Hibernate's hbm2ddl.auto=update cannot handle, such as column renames and enum value updates.
  • Method Details

    • runMigrations

      public static void runMigrations(Connection connection, boolean isSqlite)
      Runs all necessary migrations on the given database connection. Migrations are idempotent - they check if changes are needed before applying.
      Parameters:
      connection - the database connection
      isSqlite - true if using SQLite, false for MySQL/MariaDB