


createDB() function?createDB function messing up something.createDB()createDBCREATE TRIGGER deduct_coins_on_consumable
BEFORE INSERT ON ActiveConsumables
BEGIN
UPDATE accounts
SET pseudoCoins = pseudoCoins - (SELECT cost FROM Consumables WHERE id = NEW.consumableId)
WHERE
id = NEW.accountId
AND
pseudoCoins >= (SELECT cost FROM Consumables WHERE id = NEW.consumableId);
SELECT RAISE(ROLLBACK, 'Insufficient coins') WHERE changes() = 0;
END