summaryrefslogtreecommitdiff
path: root/src/backenddb/merchant-0001.sql
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-04-20 14:17:44 +0200
committerChristian Grothoff <christian@grothoff.org>2020-04-20 14:17:44 +0200
commit33ad6a9f534c2b3aeed388549abd69bb8e55b38c (patch)
tree57223e5180f1fd3e1584113079e16fe66ee53a4e /src/backenddb/merchant-0001.sql
parent64cc6eb8c6ed4b7867c76f57c7762414ab4d0685 (diff)
downloadmerchant-33ad6a9f534c2b3aeed388549abd69bb8e55b38c.tar.gz
merchant-33ad6a9f534c2b3aeed388549abd69bb8e55b38c.tar.bz2
merchant-33ad6a9f534c2b3aeed388549abd69bb8e55b38c.zip
squealing
Diffstat (limited to 'src/backenddb/merchant-0001.sql')
-rw-r--r--src/backenddb/merchant-0001.sql6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/backenddb/merchant-0001.sql b/src/backenddb/merchant-0001.sql
index 104ea47c..ad39e793 100644
--- a/src/backenddb/merchant-0001.sql
+++ b/src/backenddb/merchant-0001.sql
@@ -127,7 +127,7 @@ CREATE TABLE IF NOT EXISTS merchant_inventory
,image BYTEA NOT NULL
,taxes BYTEA NOT NULL
,price_val INT8 NOT NULL
- ,price_frac INT4 NOT NULL
+ ,price_frac cINT4 NOT NULL
,total_stock BIGINT NOT NULL
,total_sold BIGINT NOT NULL
,total_lost BIGINT NOT NULL
@@ -162,7 +162,7 @@ COMMENT ON COLUMN merchant_inventory.next_restock
CREATE TABLE IF NOT EXISTS merchant_inventory_locks
(product_serial BIGINT NOT NULL
- REFERENCES merchant_inventory (product_serial) ON DELETE CASCADE
+ REFERENCES merchant_inventory (product_serial) -- NO "ON DELETE CASCADE": locks prevent deletion!
,lock_uuid BYTEA NOT NULL CHECK (LENGTH(lock_uuid)=32)
,total_locked BIGINT NOT NULL
,expiration TIMESTAMP NOT NULL
@@ -206,7 +206,7 @@ CREATE INDEX IF NOT EXISTS merchant_orders_by_expiration
CREATE TABLE IF NOT EXISTS merchant_order_locks
(product_serial BIGINT NOT NULL
- REFERENCES merchant_inventory (product_serial) ON DELETE CASCADE
+ REFERENCES merchant_inventory (product_serial) -- NO "ON DELETE CASCADE": locks prevent deletion!
,total_locked BIGINT NOT NULL
,order_serial BIGINT NOT NULL
REFERENCES merchant_orders (order_serial) ON DELETE CASCADE