|
@@ -158,7 +158,7 @@ def create_triggers(cursor):
|
|
|
cursor.execute('''
|
|
|
CREATE TRIGGER IF NOT EXISTS not_more_ordered_than_available_after_insert
|
|
|
AFTER INSERT ON orders
|
|
|
- WHEN 0 <=
|
|
|
+ WHEN 0 >
|
|
|
-- sell_ordered_amount
|
|
|
(SELECT COALESCE(SUM(orders.ordered_amount - orders.executed_amount),0)
|
|
|
FROM orders, ownership
|
|
@@ -174,7 +174,7 @@ def create_triggers(cursor):
|
|
|
cursor.execute('''
|
|
|
CREATE TRIGGER IF NOT EXISTS not_more_ordered_than_available_after_update
|
|
|
AFTER UPDATE ON orders
|
|
|
- WHEN 0 <=
|
|
|
+ WHEN 0 >
|
|
|
-- sell_ordered_amount
|
|
|
(SELECT COALESCE(SUM(orders.ordered_amount - orders.executed_amount),0)
|
|
|
FROM orders, ownership
|