Database Architecture for “Badge” System & Arbitrary Criteria (MySQL/PHP)

前端 未结 7 1152
一生所求
一生所求 2020-12-12 10:31

Quickie-Question:

To summarize, I\'m a little confused as to how I would design such a database that allows indefinite badge-rule creation without requiring structu

相关标签:
7条回答
  • 2020-12-12 11:03

    This is going to be next to impossible to do in the database - awarding badges should be done in your business logic within the application. That way, you have all the existing data you need (edits, visits, reputation, etc.) and it can be dealt with as you see fit.

    Update:

    If by criteria you mean rules that determine if and how the badge is awarded, then that is not something that should be stored in the database. This would be almost impossible to test and maintain.

    If you mean, for example, storing the "number of edits", there's no way getting around modifying a table or stored procedure to include that data if you need it.

    0 讨论(0)
提交回复
热议问题