Prechádzať zdrojové kódy

Triggers seem to work

Eren Yilmaz 5 rokov pred
rodič
commit
b18b281c56
1 zmenil súbory, kde vykonal 2 pridanie a 2 odobranie
  1. 2 2
      db_setup.py

+ 2 - 2
db_setup.py

@@ -170,7 +170,7 @@ def create_triggers(cursor):
                      FROM ownership
                      FROM ownership
                      WHERE ownership.rowid = NEW.ownership_id)
                      WHERE ownership.rowid = NEW.ownership_id)
                 BEGIN SELECT RAISE(ROLLBACK, 'Can not order more than you own available.'); END
                 BEGIN SELECT RAISE(ROLLBACK, 'Can not order more than you own available.'); END
-                ''')  # TODO test these triggers
+                ''')
     cursor.execute('''
     cursor.execute('''
                 CREATE TRIGGER IF NOT EXISTS not_more_ordered_than_available_after_update
                 CREATE TRIGGER IF NOT EXISTS not_more_ordered_than_available_after_update
                 AFTER UPDATE ON orders
                 AFTER UPDATE ON orders
@@ -186,7 +186,7 @@ def create_triggers(cursor):
                      FROM ownership
                      FROM ownership
                      WHERE ownership.rowid = NEW.ownership_id)
                      WHERE ownership.rowid = NEW.ownership_id)
                 BEGIN SELECT RAISE(ROLLBACK, 'Can not order more than you own available.'); END
                 BEGIN SELECT RAISE(ROLLBACK, 'Can not order more than you own available.'); END
-                ''')  # TODO test these triggers
+                ''')
     cursor.execute('''
     cursor.execute('''
                 CREATE TRIGGER IF NOT EXISTS expiry_dt_in_future_after_insert
                 CREATE TRIGGER IF NOT EXISTS expiry_dt_in_future_after_insert
                 AFTER INSERT ON orders
                 AFTER INSERT ON orders