QuickShop-Community / QuickShop-Hikari

QuickShop is a shop plugin that allows players to easily sell/buy any items from a chest without any commands. In fact, none of the commands that QuickShop provides are ever needed by a player.
https://modrinth.com/plugin/quickshop-hikari
Other
85 stars 53 forks source link

Redesign database structure & refactor shop system #179

Closed Ghost-chu closed 2 years ago

Ghost-chu commented 2 years ago

Why

The current database structure design and store system design are based on block coordinates.
This means that all the stores' data stores are binded to the coordinates of the Block.

That's mean, GUI shop and multi-shops in one block is impossible to do with the current data structure.

Goal

kohle commented 2 years ago

Hope it's okay to throw my two cents in here!

I'm interested in using the data that QuickShop logs to perform an analysis on the overall server economy. Thanks for implementing MySQL, that makes it a lot easier to run queries 😁

qs_metrics

image

Essentially, it would be amazing if the database:

I absolutely love the usability of this plugin, so a better database structure would be terrific! Think about how cool it would be to have a web dashboard where you can see things like all active shops, the items they are selling, and even historical price data! Instead of having players make random prices, you could query the database to see the average transaction price of any item. So many cool things to do with data 😄

YuanYuanOwO commented 2 years ago

Hope it's okay to throw my two cents in here!

I'm interested in using the data that QuickShop logs to perform an analysis on the overall server economy. Thanks for implementing MySQL, that makes it a lot easier to run queries 😁

qs_metrics

  • Is this supposed to be an overall log of all shop activities?
  • When I remove a shop, the type is still recorded as CREATE but the price is set to 0.00

    • This might be okay except that I'm allowing free shops... DELETE or something along those lines would be much better!
  • Unfortunately, removing a shop also removes it from qs_shops. So even though the transaction (thank you for recording these) is kept, there's no way to see which shop the transaction took place with.

    • Would it make sense to either set a boolean like active to mark if a shop is deleted or not in qs_shops and have a foreign key in the qs_metrics table? Sounds like overall you want to move more towards indexing each shop rather than basing it on the coordinates (100% think this would be much better!)

image

Essentially, it would be amazing if the database:

  • Keeps track of all economic transactions
  • Records the history of chest shops, so transactions can be matched to the item, quantity, and players (owner and customer)

I absolutely love the usability of this plugin, so a better database structure would be terrific! Think about how cool it would be to have a web dashboard where you can see things like all active shops, the items they are selling, and even historical price data! Instead of having players make random prices, you could query the database to see the average transaction price of any item. So many cool things to do with data 😄

https://github.com/Ghost-chu/QuickShop-Hikari/wiki/Database-structure
hope this can help you

CarmJos commented 2 years ago

Captain, my captain, I am on standby.

Ghost-chu commented 2 years ago

Captain, my captain, I am on standby.

Glad to see you have joined database redesign project. Write access has been granted.

CarmJos commented 2 years ago

Please check my commit at https://github.com/Ghost-chu/QuickShop-Hikari/commit/def79379da6f6bb4c5388e8de1ed79c6d82a85ba

CarmJos commented 2 years ago

My job is done, bye.