summaryrefslogtreecommitdiffstats
path: root/sql.py
diff options
context:
space:
mode:
authorTomasz Kramkowski <tk@the-tk.com>2017-04-09 20:43:18 +0200
committerTomasz Kramkowski <tk@the-tk.com>2017-04-09 20:43:18 +0200
commit2f256fe553d7d556a0d8948a940be0a0214ea5ea (patch)
tree488882e81efbb75298a482f6ea6f0ebdd2bb3a11 /sql.py
parenta8bd5769fda6e10d5d95b4312ee5aa8fb376a94a (diff)
downloaddmarcpipe-2f256fe553d7d556a0d8948a940be0a0214ea5ea.tar.gz
dmarcpipe-2f256fe553d7d556a0d8948a940be0a0214ea5ea.tar.xz
dmarcpipe-2f256fe553d7d556a0d8948a940be0a0214ea5ea.zip
sql: prevent accidents with newer databases
Diffstat (limited to 'sql.py')
-rw-r--r--sql.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/sql.py b/sql.py
index 4207d4f..d3b63b0 100644
--- a/sql.py
+++ b/sql.py
@@ -70,6 +70,7 @@ def _init_db(conn):
version = c.execute('PRAGMA user_version').fetchone()[0]
if version == 1:
return
+ assert(version == 0)
c.executescript(_schema)
c.execute('PRAGMA user_version = 1')