Ajneb97 / Codex

https://www.spigotmc.org/resources/codex-rpg-discoveries-1-8-1-17.90371/
MIT License
9 stars 12 forks source link

[Bug Report] - Database has no Primary Key #12

Open UpInSmoke-FC opened 8 months ago

UpInSmoke-FC commented 8 months ago

When using MySQL, Codex creates a database with 3 columns and no primary key.

The issue is that although updates to the database use UUIDs, selects from the database use usernames. Due to this difference, not only does this mean selects won’t work correctly after a name change, but updates will still continue to update the same row for that player, despite the fact that selects will be trying to access a different row that probably doesn’t even exist with the new name, and won’t be created.

Additionally, as a result of the design for this code, if a player changes their name (even on an Online Server/Premium-Account) this results in the player data being corrupted and not being able to receive any future unlocks.

Ajneb97 commented 8 months ago

I am aware of this, and I know how to fix it, but it would require a complete rework of the plugin. As I don't have enough time right now, sadly I can't fix this.

UpInSmoke-FC commented 8 months ago

Our developer fixed this, feel free to check out our forks' commit history, I figure you probably don't want us to PR the changes in as we also re-worked the build system to make rid of some dependencies you had in replace of maven resources.

I'll leave the bug report here though for other users to reference when issues arise.

UpInSmoke-FC commented 8 months ago

https://github.com/FreedomCraft-Network/Codex