Browse Source

Fix triggers

Eren Yilmaz 6 years ago
parent
commit
886152ee63
1 changed files with 2 additions and 2 deletions
  1. 2 2
      db_setup.py

+ 2 - 2
db_setup.py

@@ -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