summaryrefslogtreecommitdiffstats
path: root/sql/trigger.sql
diff options
context:
space:
mode:
authorSebastian Reichel <sre@ring0.de>2012-12-08 23:35:33 +0100
committerSebastian Reichel <sre@ring0.de>2012-12-08 23:35:33 +0100
commit79b7424746c7636cd23a7869169431afa6941b06 (patch)
tree820a40d120a62e6f5b9b081b40e3e266d4c7a323 /sql/trigger.sql
parentb57876577516c00693ab36970a746f986bc37b66 (diff)
downloadserial-barcode-scanner-79b7424746c7636cd23a7869169431afa6941b06.tar.bz2
rename table sells -> sales
Diffstat (limited to 'sql/trigger.sql')
-rw-r--r--sql/trigger.sql6
1 files changed, 3 insertions, 3 deletions
diff --git a/sql/trigger.sql b/sql/trigger.sql
index 8a9bede..d26a39d 100644
--- a/sql/trigger.sql
+++ b/sql/trigger.sql
@@ -12,15 +12,15 @@ CREATE TRIGGER IF NOT EXISTS update_product_amount_on_restock_update AFTER UPDAT
UPDATE products SET amount = products.amount + NEW.amount WHERE products.id = NEW.product;
END;
-CREATE TRIGGER IF NOT EXISTS update_product_amount_on_sells_insert AFTER INSERT ON sells BEGIN
+CREATE TRIGGER IF NOT EXISTS update_product_amount_on_sales_insert AFTER INSERT ON sales BEGIN
UPDATE products SET amount = products.amount - 1 WHERE products.id = NEW.product;
END;
-CREATE TRIGGER IF NOT EXISTS update_product_amount_on_sells_delete AFTER DELETE ON sells BEGIN
+CREATE TRIGGER IF NOT EXISTS update_product_amount_on_sales_delete AFTER DELETE ON sales BEGIN
UPDATE products SET amount = products.amount + 1 WHERE products.id = OLD.product;
END;
-CREATE TRIGGER IF NOT EXISTS update_product_amount_on_sells_update AFTER UPDATE ON sells BEGIN
+CREATE TRIGGER IF NOT EXISTS update_product_amount_on_sales_update AFTER UPDATE ON sales BEGIN
UPDATE products SET amount = products.amount + 1 WHERE products.id = OLD.product;
UPDATE products SET amount = products.amount - 1 WHERE products.id = NEW.product;
END;