-
I have been working on putting my own server changes into modules but i have run into a small hickup or what I think might be a hickup. So far the only mods i have wanted to change are on single mod items. The issue is what if the item has multiple values to change. UPDATE So it is going to update the item to -50% casting time and located by the itemID Lets just take for instance the initial sql population looks like this INSERT INTO So given the above module change would there be a change to both values from the update and how might i go about seperating the two if that is at all possible. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
worth noting for tables with a primary key that REPLACE INTO `item_mods` VALUES (13295,455,25); -- Song Spellcasting -25% the original insert gets delated and replaced by the one specified in many cases that'll be simpler to write than updates. But you can use multiple UPDATE item_mods SET value = 25 WHERE modId = 455 AND itemID = 13295; -- update song spellcasting
UPDATE item_mods SET value = -1000 WHERE modId = 160 AND itemID = 13295; -- update Damage taken
UPDATE item_mods SET value = 350, modId = 9999 AND itemID = 13295; -- add mod that didn't exist in upstream in the case of PRIMARY KEY (`itemId`,`modId`)` in the table header |
Beta Was this translation helpful? Give feedback.
-
I knew it was going to be something simple >.< thanks for the info. It could help adding it to the modules wiki at some point maybe. |
Beta Was this translation helpful? Give feedback.
worth noting for tables with a primary key that
REPLACE INTO
is a thing that can be used.the original insert gets delated and replaced by the one specified
in many cases that'll be simpler to write than updates. But you can use multiple
UPDATE
lines with multiple values each like:in the case of
item_mods
, the primary …