put improved foreign key constraints on DB to fix bug where when I delete a cset, that was being used to compare_to, it breaks
This commit is contained in:
2
db.py
2
db.py
@@ -8,6 +8,8 @@ def connect_db(as_object):
|
||||
conn = sqlite3.connect('/data/finance.db')
|
||||
else:
|
||||
conn = sqlite3.connect('./finance.db')
|
||||
# allow deleting cset to clear our compare_to properly in finance table
|
||||
conn.execute("PRAGMA foreign_keys = ON;")
|
||||
if as_object:
|
||||
conn.row_factory = sqlite3.Row # This allows us to access columns by name
|
||||
return conn
|
||||
|
||||
Reference in New Issue
Block a user