Files
LedD/ledd/db_helper.py
Giovanni Harting d79dde527f first implementation of protobuf
restructure in client server model
loads of work still missing
2017-01-31 15:00:44 +01:00

23 lines
426 B
Python

DB_VERSION = 1
def check_db(conn):
cur = conn.cursor()
cur.execute("SELECT value FROM meta WHERE name='version'")
ver = cur.fetchone()
if ver:
ver = int(ver)
if ver < DB_VERSION:
upgrade_db(conn, ver, DB_VERSION)
else:
with open('sql/ledd.sql', 'r') as f:
cur.executescript(f.read())
conn.commit()
def upgrade_db(conn, old, new):
pass