Closed FurryKitten closed 3 years ago
In the new update i've pushed on github, I am planning not to use the balances table anymore. But the primary key thing is needed for accounts which is something im gonna do
Would you mind take a look with the version you get from github now? Test it with the 4.9.1 version on spigot and this one you can compile here?
I might have forgotten to add something that removes all duplicates...
Yep. I'll check it soon.
I might have forgotten to add something that removes all duplicates...
Yes, there are exception for already existing db with duplicates: "Duplicate entry '...' for key PRIMARY" I saved my db with duplicates to test this feature.
I tested new version on empty db. Works fine.
Alright, then its just for me to fix the duplicates.
Alright, then its just for me to fix the duplicates.
Could you test again now? I've added something that should remove the duplicate accounts from the table. And it should not affect anything else
No, it isn't working. I restored my bd with duplicates created on version 558a636d4e02701362d05034577bf5af85274cbe, restarted server with latest GemsEco build.
After this, rows with new balance format were added, but old duplicates still exist.
Is it old problem? Because I started using this plugin with 558a636d4e02701362d05034577bf5af85274cbe version.
I've never personally used this plugin so I don't know :/ Maybe i should just clear the entire table since in the old versions it is no valuable information stored there.. and when players login their balances will be transferred from the balances table into their newly created account in the accounts table
I pushed an update now, that should truncate the table, and you should get your balances when you login with your alts or so
Could you please test it once more? if you have the time of course
I tested this carefully and it works perfect for me.
Hi. You merged my pull request, but the problem was bigger than I thought. This is how database looks now
A lot of duplicates, but with different IDs.
The problem is here - "ON DUPLICATE KEY UPDATE". It works only with primary keys or unique index. Queries in code with ODKU doesn't contain primary key. And balances table doesn't even have primary key.
I think the solution here is to make CREATE queries with unique indexes (uuid mb). Or, for existing tables, rewrite SELECT queries (https://stackoverflow.com/a/46952400)