You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We need a way to attach a schema version to the database, A Metadata table with a db_version which we can read and track.
We can then have a class or something which has an array of functions to run.
if the db_version doesnt exist in the table, check if the id_old column exists on the islands table, if it does set the version to the array.length, if it doesnt set the version to 0
And then run all functions from current_version to max_version, we need to then ensure that each function runs all sql as a transaction + creates backups after each run, and bumps the version
We can then modify the table to something like
ALTER TABLE island RENAME COLUMN Id to Id_old
ALTER TABLE island ADD COLUMN Id TEXT
We then need to generate the Id table to create a UUID, we can potentially do this part in java code? Create a HashMap<int, UUID> to ensure that the same int generates the same UUID?
We need to convert Database sequential Id's to UUID
This would provide the benifit that at certain places:
https://github.com/Iridium-Development/IridiumSkyblock/blob/master/src/main/java/com/iridium/iridiumskyblock/managers/IslandManager.java#L731
https://github.com/Iridium-Development/IridiumSkyblock/blob/master/src/main/java/com/iridium/iridiumskyblock/managers/IslandManager.java#L782
https://github.com/Iridium-Development/IridiumSkyblock/blob/master/src/main/java/com/iridium/iridiumskyblock/managers/DatabaseManager.java#L128
We need to save the record in order to create the ID, this creates some lag as it sometimes has to be done syncronously.
converting to UUID means we can do this on runtime without relying on a database save.
Main issue with this is converting the current numerical Id's to a UUID
The text was updated successfully, but these errors were encountered: