I'm trying to figure out how to make my database tables in order to have enhance items (+0, +1, ...).
What I have: StatType (hp, str, ...) -> ItemStat (ItemId, StatId, Value) <- Item (Id, name, ...)
The thing is, I want to make items enhanced, so I tought:
1 - on the ItemStat(ItemId, StatId, EnhanceLevel, Value) Problem: How can I ensure that each enhance level gives a value to each stat of the item
2 - A way to solve the problem would be having a new table: ItemBaseStats (ItemId, StatId) so there would be all the base stats of the item and than in the ItemStat(ItemId, StatId, EnhanceLevel, Value) before the insert I would check the ItemBaseStats.
The thing is, is this the right/a good aproach? What am I missing? Should the check be on database side (so inserts would be via StoredProcedure), should it be in code? maybe both?
The thing is I want to avoid errors and each enhance have to specify a value for each base stat (that's a rule).
And btw, I'm using C# with EF Core (SQL Server) so everything will be done via code, but I need to figure this out because it will change the way the model will be built and written).