Updated javadoc for database Patches

This commit is contained in:
Risto Lahtela 2021-01-01 11:31:40 +02:00
parent 9b692480da
commit 47633cad37
24 changed files with 148 additions and 0 deletions

View File

@ -18,6 +18,8 @@ package com.djrapitops.plan.storage.database.transactions.patches;
/**
* Patch that removes plan_commandusages table.
* <p>
* See https://github.com/plan-player-analytics/Plan/issues/1240 for more details
*
* @author Rsl1122
*/

View File

@ -26,6 +26,8 @@ import static com.djrapitops.plan.storage.database.sql.building.Sql.*;
/**
* Patch that replaces plan_ips with plan_geolocations table.
* <p>
* Prepares Plan to be GDPR compliant through the easiest to make change.
*
* @author Rsl1122
*/

View File

@ -18,6 +18,11 @@ package com.djrapitops.plan.storage.database.transactions.patches;
import com.djrapitops.plan.storage.database.sql.tables.TPSTable;
/**
* Adds disk usage information to tps table.
*
* @author Rsl1122
*/
public class DiskUsagePatch extends Patch {
@Override

View File

@ -23,6 +23,11 @@ import com.djrapitops.plan.storage.database.sql.building.Sql;
import com.djrapitops.plan.storage.database.sql.tables.ExtensionPlayerTableValueTable;
import com.djrapitops.plan.storage.database.sql.tables.ExtensionServerTableValueTable;
/**
* Increases the length of Strings in extension tables to 250 to avoid cutoffs and exceptions.
*
* @author Rsl1122
*/
public class ExtensionTableRowValueLengthPatch extends Patch {
private final String playerTable;

View File

@ -18,6 +18,11 @@ package com.djrapitops.plan.storage.database.transactions.patches;
import com.djrapitops.plan.storage.database.sql.tables.GeoInfoTable;
/**
* Adds last_used field to the geolocation table.
*
* @author Rsl1122
*/
public class GeoInfoLastUsedPatch extends Patch {
@Override

View File

@ -20,6 +20,11 @@ import com.djrapitops.plan.storage.database.sql.tables.GeoInfoTable;
import static com.djrapitops.plan.storage.database.sql.building.Sql.*;
/**
* Replaces user_id foreign keys with user_uuid fields in geolocation table.
*
* @author Rsl1122
*/
public class GeoInfoOptimizationPatch extends Patch {
private final String tempTableName;

View File

@ -21,6 +21,13 @@ import com.djrapitops.plan.storage.database.sql.tables.KillsTable;
import static com.djrapitops.plan.storage.database.sql.building.Sql.FROM;
/**
* Replaces killer_id, victim_id and server_id foreign keys with respective uuid fields in kills table.
* <p>
* This was to "reduce the amount of joins when querying sessions".
*
* @author Rsl1122
*/
public class KillsOptimizationPatch extends Patch {
private final String tempTableName;

View File

@ -24,6 +24,14 @@ import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.Map;
/**
* Adds server_id field to kills table.
* <p>
* The field is populated by querying the session table for server ids.
*
* @author Rsl1122
* @see KillsOptimizationPatch for removal of this field later
*/
public class KillsServerIDPatch extends Patch {
@Override

View File

@ -31,6 +31,12 @@ import java.util.Map;
import static com.djrapitops.plan.storage.database.sql.building.Sql.*;
/**
* Populates new linked_to_uuid field with the uuid of a username (same as minecraft name) or 'console'.
*
* @author Rsl1122
* @see LinkedToSecurityTablePatch for addition of the field.
*/
public class LinkUsersToPlayersSecurityTablePatch extends Patch {
@Override

View File

@ -19,6 +19,14 @@ package com.djrapitops.plan.storage.database.transactions.patches;
import com.djrapitops.plan.storage.database.sql.building.Sql;
import com.djrapitops.plan.storage.database.sql.tables.SecurityTable;
/**
* Adds linked_to_uuid field to plan_security table that stores web users.
* <p>
* This patch allows web users to have a username other than the minecraft username.
*
* @author Rsl1122
* @see LinkUsersToPlayersSecurityTablePatch for the patch that populates the field afterwards.
*/
public class LinkedToSecurityTablePatch extends Patch {
@Override

View File

@ -35,6 +35,13 @@ import java.util.UUID;
import static com.djrapitops.plan.storage.database.sql.building.Sql.AND;
import static com.djrapitops.plan.storage.database.sql.building.Sql.WHERE;
/**
* Adds last_seen to nickname table by populating it with the data in actions table, and removes the actions table.
* <p>
* Actions table contained nickname change events and change to "last seen" saved space on the interface.
*
* @author Rsl1122
*/
public class NicknameLastSeenPatch extends Patch {
@Override

View File

@ -21,6 +21,13 @@ import com.djrapitops.plan.storage.database.sql.tables.NicknamesTable;
import static com.djrapitops.plan.storage.database.sql.building.Sql.FROM;
/**
* Replaces user_id and server_id foreign keys with respective uuid fields in nickname table.
* <p>
* This was to "reduce the amount of joins when querying sessions".
*
* @author Rsl1122
*/
public class NicknamesOptimizationPatch extends Patch {
private final String tempTableName;

View File

@ -21,6 +21,11 @@ import com.djrapitops.plan.storage.database.sql.tables.PingTable;
import static com.djrapitops.plan.storage.database.sql.building.Sql.FROM;
/**
* Replaces user_id and server_id foreign keys with respective uuid fields in ping table.
*
* @author Rsl1122
*/
public class PingOptimizationPatch extends Patch {
private final String tempTableName;

View File

@ -31,6 +31,15 @@ import java.util.UUID;
import static com.djrapitops.plan.storage.database.sql.building.Sql.*;
/**
* Changes register dates on networks to the smallest number found in the database.
* <p>
* Proxy servers do not store player register date information, so Game servers can hold earlier
* join date than the first session Plan sees. This patch changes the register date in
* plan_users if a smaller register date in plan_user_info is found.
*
* @author Rsl1122
*/
public class RegisterDateMinimizationPatch extends Patch {
private Map<UUID, Long> registerDates;

View File

@ -18,6 +18,11 @@ package com.djrapitops.plan.storage.database.transactions.patches;
import com.djrapitops.plan.storage.database.sql.tables.SessionsTable;
/**
* Adds afk_time field to sessions table.
*
* @author Rsl1122
*/
public class SessionAFKTimePatch extends Patch {
@Override

View File

@ -21,6 +21,13 @@ import com.djrapitops.plan.storage.database.sql.tables.SessionsTable;
import static com.djrapitops.plan.storage.database.sql.building.Sql.FROM;
/**
* Replaces user_id and server_id foreign keys with respective uuid fields in sessions table.
* <p>
* This was to "reduce the amount of joins when querying sessions".
*
* @author Rsl1122
*/
public class SessionsOptimizationPatch extends Patch {
private final String tempTableName;

View File

@ -16,6 +16,13 @@
*/
package com.djrapitops.plan.storage.database.transactions.patches;
/**
* Removes plan_transfer table, used for transferring html in the database.
* <p>
* The idea turned out to use a lot of disk space and improper use of a database.
*
* @author Rsl1122
*/
public class TransferTableRemovalPatch extends Patch {
@Override

View File

@ -21,6 +21,11 @@ import com.djrapitops.plan.storage.database.sql.tables.UserInfoTable;
import static com.djrapitops.plan.storage.database.sql.building.Sql.FROM;
/**
* Replaces user_id and server_id foreign keys with respective uuid fields in user info table.
*
* @author Rsl1122
*/
public class UserInfoOptimizationPatch extends Patch {
private final String tempTableName;

View File

@ -24,6 +24,18 @@ import java.util.Optional;
import static com.djrapitops.plan.storage.database.sql.building.Sql.FROM;
/**
* Table schema change patch for version 4.0.0 to support BungeeCord servers.
* <p>
* This patch makes the database compatible with further changes to the schema,
* bugs in this patch are possible, as the patch is untested against new schema.
* <p>
* Version 10 comes from "schema version" that was in use in the database to version changes
* before Patch system was implemented.
*
* @author Rsl1122
* @see VersionTableRemovalPatch for Patch that removes the schema versions
*/
public class Version10Patch extends Patch {
private Integer serverID;

View File

@ -16,6 +16,11 @@
*/
package com.djrapitops.plan.storage.database.transactions.patches;
/**
* Removes the table schema versioning table.
*
* @author Rsl1122
*/
public class VersionTableRemovalPatch extends Patch {
@Override

View File

@ -21,6 +21,13 @@ import com.djrapitops.plan.storage.database.sql.tables.WorldTimesTable;
import static com.djrapitops.plan.storage.database.sql.building.Sql.FROM;
/**
* Replaces server_id foreign keys with server_uuid field in world times table.
* <p>
* This was to "reduce the amount of joins when querying sessions".
*
* @author Rsl1122
*/
public class WorldTimesOptimizationPatch extends Patch {
private final String tempTableName;

View File

@ -26,6 +26,12 @@ import java.util.Map;
import static com.djrapitops.plan.storage.database.sql.building.Sql.WHERE;
/**
* Adds server_id field to world times table.
*
* @author Rsl1122
* @see WorldTimesOptimizationPatch for removal of this field later
*/
public class WorldTimesSeverIDPatch extends Patch {
@Override

View File

@ -21,6 +21,13 @@ import com.djrapitops.plan.storage.database.sql.tables.WorldTable;
import static com.djrapitops.plan.storage.database.sql.building.Sql.FROM;
/**
* Replaces server_id foreign keys with server_uuid field in world table.
* <p>
* This was to "reduce the amount of joins when querying sessions".
*
* @author Rsl1122
*/
public class WorldsOptimizationPatch extends Patch {
private final String tempTableName;

View File

@ -34,6 +34,12 @@ import java.util.stream.Collectors;
import static com.djrapitops.plan.storage.database.sql.building.Sql.*;
/**
* Adds server_id field to worlds table.
*
* @author Rsl1122
* @see WorldsOptimizationPatch for removal of the field.
*/
public class WorldsServerIDPatch extends Patch {
@Override