Closed Heavybob closed 4 months ago
This change modifies the Inventories table. To ensure compatability with your existing db, you'll need to run the following.
UPDATE Inventories SET InventoryId = PlayerId WHERE IsPlayerInventory = 1;
Drop Id, drop PlayerId, set InventoryId as Primary Key.
Added a hotfix to resolve creation. This should be good to merge now.
Here is a picture of the db changes.
This change simplifies inventories by setting InventoryId as the primary key. Instead of saying PlayerInventory, we set the InventoryId for those entries to the PlayerId. We're also removing the PlayerId column from the table as its no longer needed. To obtain if an entry is a player inventory, we still have the IsPlayerInventory bool.
This change is a stepping stone towards improved bulk updating of inventories as the current implementation updates all inventories one at a time rather than all at once.
This change has been tested and works.