Fix the blocks table index

This commit is contained in:
zontreck 2024-04-24 04:15:31 -07:00
parent 43a1a44a8f
commit ab6f9130f0
2 changed files with 10 additions and 1 deletions

View file

@ -53,7 +53,7 @@ mod_name=Zontreck's Library Mod
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
mod_license=GPLv3
# The mod version. See https://semver.org/
mod_version=1201.13.042424.0339
mod_version=1201.13.042424.0415
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
# This should match the base package used for the mod sources.
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html

View file

@ -133,6 +133,15 @@ public class DatabaseMigrations
migrations.add(blocksUpdate);
migrations.add(builder()
.withTableID("blocks")
.withVersion(3)
.withMigrationAction(DatabaseWrapper.get().prepareStatement(" ALTER TABLE `blocks` DROP INDEX `posX`; "))
.withMigrationAction(DatabaseWrapper.get().prepareStatement(" ALTER TABLE `blocks` DROP INDEX `posY`; "))
.withMigrationAction(DatabaseWrapper.get().prepareStatement(" ALTER TABLE `blocks` DROP INDEX `posZ`; "))
.withMigrationAction(DatabaseWrapper.get().prepareStatement("ALTER TABLE `savedBlocks`.`blocks` ADD UNIQUE (`posX`, `posY`, `posZ`); ")));
RegisterMigrationsEvent rme = new RegisterMigrationsEvent();
MinecraftForge.EVENT_BUS.post(rme);